Reputation: 5093
I'm trying to set up a Wildfly 11 cluster but I'm not able to make it work. Basically, I have 2 instances of Wildfly with one instance having port-offset=2 running on my local machine. Here are the publisher and MDB:
@JMSDestinationDefinitions(value = { @JMSDestinationDefinition(name = "java:/topic/CLUSTEREVENTTOPIC", interfaceName = "javax.jms.Topic", destinationName = "ClusterEventTopic") })
@Stateless
public class ClusterEventPublisher implements Serializable {
MDB
@MessageDriven(name = "ClusterEventMonitor", activationConfig = { @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "topic/CLUSTEREVENTTOPIC"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") })
public class ClusterEventMonitor implements MessageListener {
Note that I'm able to see this topic created on Wildfly, but when I publish a message on the topic. It's only read by the node that sends the message.
For example: node1 sends an eventDto as the message, node1 will receive the message but not node2.
Note that I'm using standalone-full-ha.xml configuration. I just added the following line in ActiveMQ module:
<cluster password="${jboss.messaging.cluster.password:opencell}"/>
Full config is downloadable from, note that the second instance has exactly the same configuration with the only difference being the port-offset value:
https://www.dropbox.com/s/0ttyb05dx7cps21/standalone-full-ha-test.xml
I'm on debug mode and sure that the message doesn't reach node2. Any idea?
Upvotes: 1
Views: 985
Reputation: 5093
I'm now able to receive the message send from node1 via JMS in node2. However, I really did not do anything. I compared my configuration files and they are almost the same with my first set of nodes that don't work. What I did was just download a new Wildfly 11 zipped, do the necessary database configuration and it worked. For those asking, here's part of my standalone-full-ha.xml config:
<subsystem xmlns="urn:jboss:domain:jgroups:5.0">
<channels default="ee">
<channel name="ee" stack="udp" cluster="ejb"/>
</channels>
<stacks>
<stack name="udp">
<transport type="UDP" socket-binding="jgroups-udp"/>
<protocol type="PING"/>
<protocol type="MERGE3"/>
<protocol type="FD_SOCK"/>
<protocol type="FD_ALL"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS"/>
<protocol type="UFC"/>
<protocol type="MFC"/>
<protocol type="FRAG2"/>
</stack>
<stack name="tcp">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<socket-protocol type="MPING" socket-binding="jgroups-mping"/>
<protocol type="MERGE3"/>
<protocol type="FD_SOCK"/>
<protocol type="FD_ALL"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS"/>
<protocol type="MFC"/>
<protocol type="FRAG2"/>
</stack>
</stacks>
</subsystem>
<subsystem xmlns="urn:jboss:domain:messaging-activemq:2.0">
<server name="default">
<cluster password="${jboss.messaging.cluster.password:secret}"/>
<security-setting name="#">
<role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
</security-setting>
<address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10" redistribution-delay="1000"/>
<http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
<http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
<param name="batch-delay" value="50"/>
</http-connector>
<in-vm-connector name="in-vm" server-id="0">
<param name="buffer-pooling" value="false"/>
</in-vm-connector>
<http-acceptor name="http-acceptor" http-listener="default"/>
<http-acceptor name="http-acceptor-throughput" http-listener="default">
<param name="batch-delay" value="50"/>
<param name="direct-deliver" value="false"/>
</http-acceptor>
<in-vm-acceptor name="in-vm" server-id="0">
<param name="buffer-pooling" value="false"/>
</in-vm-acceptor>
<broadcast-group name="bg-group1" jgroups-channel="activemq-cluster" connectors="http-connector"/>
<discovery-group name="dg-group1" jgroups-channel="activemq-cluster"/>
<cluster-connection name="my-cluster" address="jms" connector-name="http-connector" discovery-group="dg-group1"/>
<jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
<jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
<connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
<connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector" ha="true" block-on-acknowledge="true" reconnect-attempts="-1"/>
<pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
</server>
</subsystem>
As for infinispan cache:
<cache-container name="projectx">
<transport lock-timeout="60000"/>
<replicated-cache name="projectx-cache" mode="SYNC">
<transaction mode="NON_XA"/>
<eviction strategy="LRU" max-entries="100000"/>
</replicated-cache>
And ActiveMQ
<subsystem xmlns="urn:jboss:domain:messaging-activemq:2.0">
<server name="default">
<cluster password="${jboss.messaging.cluster.password:secret}"/>
Make sure that you bind your server to your IP address or 0.0.0.0 for testing.
Upvotes: 1