GH-194: Propagate policy into MessageListener

Fixes https://github.com/spring-projects/spring-integration-extensions/issues/194

The `HazelcastEventDrivenMessageProducer.HazelcastMessageListener.processEvent()`
is missing to propagate the configured `CacheListeningPolicy`, thus
only the local member is able to listen message from the `ITopic`

* Add `getCacheListeningPolicy()` to the third argument of the `sendMessage()`
in the `HazelcastEventDrivenMessageProducer.HazelcastMessageListener.processEvent()`
This commit is contained in:
Artem Bilan
2018-05-31 17:47:56 -04:00
parent d15787bcd9
commit d0df6dc5a8
2 changed files with 5 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ compileTestJava {
ext {
hazelcastVersion = '3.8.9'
slf4jVersion = '1.7.25'
springIntegrationVersion = '4.3.14.RELEASE'
springIntegrationVersion = '4.3.16.RELEASE'
idPrefix = 'hazelcast'

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,6 +46,7 @@ import com.hazelcast.map.listener.MapListener;
*
* @author Eren Avsarogullari
* @author Artem Bilan
*
* @since 1.0.0
*/
public class HazelcastEventDrivenMessageProducer extends AbstractHazelcastMessageProducer {
@@ -61,7 +62,7 @@ public class HazelcastEventDrivenMessageProducer extends AbstractHazelcastMessag
}
@Override
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings({ "rawtypes", "unchecked" })
protected void doStart() {
if (this.distributedObject instanceof IMap) {
setHazelcastRegisteredEventListenerId(((IMap<?, ?>) this.distributedObject)
@@ -168,7 +169,7 @@ public class HazelcastEventDrivenMessageProducer extends AbstractHazelcastMessag
@Override
protected void processEvent(Message<E> event) {
sendMessage(event, event.getPublishingMember().getSocketAddress(), null);
sendMessage(event, event.getPublishingMember().getSocketAddress(), getCacheListeningPolicy());
if (logger.isDebugEnabled()) {
logger.debug("Received Message : " + event);