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
@Override | |
@Cacheable(value = "invoicesCache", key = "#invoiceId") | |
public Invoice getInvoice(String invoiceId) { | |
// Get data from backend service | |
} | |
@Override | |
@CacheEvict(value = "invoicesCache", key = "#invoiceId") | |
public void evictInvoicesCache(String invoiceId) { | |
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
<cache name="invoicesCache" eternal="false" maxElementsInMemory="1000" overflowToDisk="false" | |
diskPersistent="false" timeToIdleSeconds="0" timeToLiveSeconds="3600" memoryStoreEvictionPolicy="LRU"/> |
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
@Component | |
public class MqttComponentPurePahoImpl implements MqttComponent { | |
private final String mqttUrl; | |
private final String mqttUser; | |
private final String mqttPassword; | |
private final String displayNameNode; | |
private final ObjectWriter objectWriter; | |
private MqttClient mqttClient; |
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
// Snippet of code used to evict invoices cache when mqtt messages arrive. We assume we have an mqttComponent and | |
// an invoiceService correctly defined in the current scope | |
mqttComponent.subscribeToTopicWithEmptyPayload("caches/invoices/+/evict",evictInvoiceCache(),1); | |
// ... | |
private Function<String,Void> evictInvoiceCache() { | |
return topic->{ |
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
import java.util.Calendar; | |
import lombok.Builder; | |
import lombok.Value; | |
@Builder | |
@Value | |
public class JacksonExample { | |
private String fieldOne; | |
private String fieldTwo; |
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
import java.util.Calendar; | |
import lombok.Builder; | |
import lombok.Value; | |
import com.fasterxml.jackson.annotation.JsonIgnore; | |
@Builder | |
@Value |
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
import java.util.Calendar; | |
import lombok.Builder; | |
import lombok.Value; | |
import com.fasterxml.jackson.annotation.JsonFormat; | |
import com.fasterxml.jackson.annotation.JsonIgnore; | |
import com.fasterxml.jackson.databind.PropertyNamingStrategy; | |
import com.fasterxml.jackson.databind.annotation.JsonNaming; |
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
public enum JacksonExampleEnum { | |
OPTION_1("0", "0"), OPTION_2("1", "1"); | |
private String a; | |
private String b; | |
JacksonTestEnum(String a, String b) { | |
this.a = a; | |
this.b = b; | |
} |
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
import java.util.Calendar; | |
import lombok.Builder; | |
import lombok.Value; | |
import com.fasterxml.jackson.annotation.JsonFormat; | |
import com.fasterxml.jackson.annotation.JsonIgnore; | |
import com.fasterxml.jackson.databind.PropertyNamingStrategy; | |
import com.fasterxml.jackson.databind.annotation.JsonNaming; |
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
import com.fasterxml.jackson.annotation.JsonValue; | |
public enum JacksonExampleEnum { | |
OPTION_1("0", "0"), OPTION_2("1", "1"); | |
private String a; | |
private String b; | |
JacksonTestEnum(String a, String b) { | |
this.a = a; | |
this.b = b; |
OlderNewer