From d0df6dc5a851b47371ed0887b4cb0e8850834af2 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Thu, 31 May 2018 17:47:56 -0400 Subject: [PATCH] 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()` --- spring-integration-hazelcast/build.gradle | 2 +- .../inbound/HazelcastEventDrivenMessageProducer.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-integration-hazelcast/build.gradle b/spring-integration-hazelcast/build.gradle index e2f7eb1..353717e 100644 --- a/spring-integration-hazelcast/build.gradle +++ b/spring-integration-hazelcast/build.gradle @@ -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' diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastEventDrivenMessageProducer.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastEventDrivenMessageProducer.java index 3c483b0..dbf17e3 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastEventDrivenMessageProducer.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastEventDrivenMessageProducer.java @@ -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 event) { - sendMessage(event, event.getPublishingMember().getSocketAddress(), null); + sendMessage(event, event.getPublishingMember().getSocketAddress(), getCacheListeningPolicy()); if (logger.isDebugEnabled()) { logger.debug("Received Message : " + event);