Skip to content

Instantly share code, notes, and snippets.

@codingtim
codingtim / inboundAdapter
Last active August 29, 2015 14:22
SI inbound adapter
IntegrationFlows
.from(jmsInboundChannelAdapter())
.channel(inboundChannel())
.get();
@codingtim
codingtim / channelAdapter
Created June 4, 2015 08:15
SI channel adapter
Jms.messageDriverChannelAdapter(jmsFactory)
.configureListenerContainer(defaultMessageListenerContainerJmsListenerContainerSpec ->
defaultMessageListenerContainerJmsListenerContainerSpec.sessionTransacted(true))
.destination(QUEUE1)
.get();
@codingtim
codingtim / subscribableChannel
Created June 4, 2015 08:16
SI subscribable channel
IntegrationFlows
.from(inboundChannel())
.transform(...)
.filter(...)
.channel(subscribableChannel())
.get();
@codingtim
codingtim / outboundAdapter
Created June 4, 2015 08:17
SI outbound adapter
IntegrationFlows
.from(subscribableChannel())
.handle(Jms.outboundAdapter(jmsFactory).destination(QUEUE2))
.get();
@codingtim
codingtim / outboundAdapter
Created June 4, 2015 08:18
SI outbound adapter fix
IntegrationFlows
.from(subscribableChannel())
.handle(Jms.outboundAdapter(jmsTemplate).destination(QUEUE2))
.get();
public class EntityServiceImp implements EntityService {
private EntityRepository repository;
private ImageService imageService;
@Override
public void update(String id, UpdateData updateData) {
Entity entity = repository.find(id);
entity.setDescription(updateData.getDescription());
entity.setTitle(updateData.getTitle());
public class EntityServiceImpl implements EntityService {
private EntityRepository repository;
private ImageService imageService;
@Override
public void update(String id, UpdateData updateData) {
Entity entity = repository.find(id);
entity.setDescription(updateData.getDescription());
entity.setTitle(updateData.getTitle());
public class EntityServiceImpl implements EntityService {
private EntityRepository repository;
private ImageService imageService;
@Override
public void update(String id, UpdateData updateData) {
Entity entity = repository.find(id);
ImageEntity image = imageService.getImage(updateData.getImageUrl());
public class EntityServiceImpl implements EntityService {
private EntityRepository repository;
private ImageService imageService;
private EntityObservers entityObservers;
@Override
public void update(String id, UpdateData updateData) {
Entity entity = repository.find(id);
@codingtim
codingtim / InMemoryMongo.java
Last active August 27, 2016 09:51
InMemoryMongo for elastic 2
public class InMemoryMongo {
private static final String DATA_PATH = "./target/elasticsearch";
private Node node;
private Client client;
public InMemoryMongo() {
}
public InMemoryMongo start() {