This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server.port=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping(value = ["/controller"]) | |
class Controller { | |
@Autowired lateinit var cache: Cache | |
@GetMapping(path = ["{key}"]) | |
fun getStuff(@PathVariable("key") key: String) = cache.getUUID(key) | |
} | |
@CacheConfig(cacheNames = ["map"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.ozsie.hazelcast | |
import com.hazelcast.config.Config | |
import com.hazelcast.config.EvictionPolicy | |
import com.hazelcast.config.MapConfig | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration | |
import org.springframework.boot.autoconfigure.SpringBootApplication | |
import org.springframework.boot.runApplication | |
import org.springframework.cache.annotation.EnableCaching | |
import org.springframework.context.annotation.Bean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.ozsie.hazelcast | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration | |
import org.springframework.boot.autoconfigure.SpringBootApplication | |
import org.springframework.boot.runApplication | |
@SpringBootApplication | |
@EnableAutoConfiguration | |
class HazelcastApplication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.hazelcast</groupId> | |
<artifactId>hazelcast</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>com.hazelcast</groupId> | |
<artifactId>hazelcast-spring</artifactId> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# suppress inspection "UnusedProperty" for whole file | |
context.initializer.classes=com.github.ozsie.webfluxtest.Beans |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.ozsie.webfluxtest | |
import com.github.ozsie.webfluxtest.handlers.ItemHandler | |
import com.github.ozsie.webfluxtest.routers.router | |
import org.springframework.context.ApplicationContextInitializer | |
import org.springframework.context.support.GenericApplicationContext | |
import org.springframework.context.support.beans | |
// See application.properties context.initializer.classes entry | |
class Beans : ApplicationContextInitializer<GenericApplicationContext> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.ozsie.webfluxtest.routers | |
import com.github.ozsie.webfluxtest.handlers.ItemHandler | |
import org.springframework.http.MediaType.APPLICATION_JSON | |
import org.springframework.web.reactive.function.server.router | |
fun router(itemHandler: ItemHandler) = router { | |
accept(APPLICATION_JSON).nest { | |
"/api".nest { | |
"/items".nest { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.ozsie.webfluxtest.handlers | |
import com.github.ozsie.webfluxtest.ItemRepository | |
import com.github.ozsie.webfluxtest.model.Item | |
import org.springframework.http.MediaType.APPLICATION_JSON | |
import org.springframework.web.reactive.function.server.ServerRequest | |
import org.springframework.web.reactive.function.server.ServerResponse | |
class ItemHandler(private val itemRepository: ItemRepository) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.ozsie.webfluxtest.model | |
import org.springframework.data.annotation.Id | |
data class Item(@Id val id: String?, val value: String) |
NewerOlder