2

I am trying to configure a JMS cluster in wildfly. I've got the queue to work, but I read about an interesting property in the docs:

.address: Each cluster connection only applies to messages sent to an address that starts with this value. Note: this does not use wild-card matching.

As far as I understood this allows me to create different clusters for different queues. Each cluster will "listen" only to messages sent to a given address that starts with the value defined in the address property. It caught my attention and I am trying to make it work, so I have two queues:

<jms-queue name="ClusteredQueue">
    <entry name="java:/jms/queue/ClusteredQueue"/>
    <entry name="jms/queue/ClusteredQueue"/>
</jms-queue>
<jms-queue name="SecondClusteredQueue">
    <entry name="java:/jms/queue/SecondClusteredQueue"/>
    <entry name="queue/SecondClusteredQueue"/>
</jms-queue>

And I tried setting the cluster connection:

<cluster-connections>
    <cluster-connection name="my-cluster">
        <address>jms</address>
        <connector-ref>http-connector</connector-ref>
        <discovery-group-ref discovery-group-name="dg-group1"/>
    </cluster-connection>
</cluster-connections>

This works.

What I do not understand is: in this sentence

...applies to messages sent to an address that starts with this value...

What exactly is the "address"?

But I want only one queue to be clustered, but anything I try makes both queues not to be accessible. (The sender send the message, but the receiver, who lies in another Wildfly instance on my machine never receives it)

Values I tried:

  1. S
  2. queue

If the address is the jms-queue.name, the first case should cause SecondClusteredQueue to receive, but not ClusteredQueue If jms-queue.entry.name is the address, the example 2. should cause SecondClusteredQueue to receive, but not ClusteredQueue.

As already said, in both cases no queue received the message.

IF it helps, my producer gets the query injected with this code:

@Resource(mappedName = "java:/jms/queue/ClusteredQueue")
private transient Queue myQueue;

@Resource(mappedName = "java:/queue/SecondClusteredQueue")
private transient Queue myNewQueue;

My Receivers (MDB) has the following annotations:

// Receiver for ClusteredQueue @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "java:/jms/queue/ClusteredQueue"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") }) //Receiver for SecondClusteredQueue @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "java:/jms/queue/SecondClusteredQueue"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") })

JSBach
  • 4,679
  • 8
  • 51
  • 98

0 Answers0