Pergunta

I'm having problem to configure a JMS Topic in my GlassFish 3.1.2.2.

I have a cluster with one node and 4 local instances in this node. I want a JMS Topic on which I send a message and all instance receive the message.

I read about useSharedSubscriptionInClusteredContainer and I set it to false which is supposed to do what I want but doesn't. With my test, when I send a message on the Topic, only one of the four instances receive the mesage.

I know it's the default behavior of a JMS Topic on a cluster but it's not what I want. Can anyone say me what I do wrong? Thanks for your answer.

Foi útil?

Solução

Assuming that you are listening on the topic using a Message Driven Bean, then by default they are all listening with the same client id.

I managed to specify a different client id for each instance by setting the following annotation :

@MessageDriven(mappedName="jms/YourTopic", 
activationConfig =  {
  @ActivationConfigProperty(propertyName = "clientID", propertyValue="${com.sun.aas.instanceName}")
})
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top