Hi 

My requirement is to send the the message to one of the 2 MDB's created, of
which both are subscribed to the same topic. 
 MDB1: 
@MessageDriven(name = "TOPICMDB1", activationConfig =
        { @ActivationConfigProperty(propertyName = "destinationType", 
propertyValue
= "javax.jms.Topic"),
                @ActivationConfigProperty(propertyName = "destination", 
propertyValue =
"ATOPIC"),
                @ActivationConfigProperty(propertyName = "maxSession", 
propertyValue =
"5"),
                @ActivationConfigProperty(propertyName = "acknowledgeMode", 
propertyValue
= "Auto-acknowledge"),
            @ActivationConfigProperty(propertyName = "subscriptionName",
propertyValue = "mytopic"),
            @ActivationConfigProperty(propertyName = "subscriptionDurability",
propertyValue = "durable"),
            @ActivationConfigProperty(propertyName = "shareSubscriptions",
propertyValue="true"),
            @ActivationConfigProperty(propertyName = "clientId", propertyValue =
"MyClientId_1")
        
        })


        public class TopicListener1 implements MessageListener,
java.io.Serializable

MDB2: 

@MessageDriven(name = "TOPICMDB2", activationConfig =
{ @ActivationConfigProperty(propertyName = "destinationType", propertyValue
= "javax.jms.Topic"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue =
"ATOPIC"),
        @ActivationConfigProperty(propertyName = "maxSession", propertyValue =
"5"),
        @ActivationConfigProperty(propertyName = "acknowledgeMode", 
propertyValue =
"Auto-acknowledge"), 
@ActivationConfigProperty(propertyName = "subscriptionName", propertyValue =
"mytopic"),
@ActivationConfigProperty(propertyName = "subscriptionDurability",
propertyValue = "durable"),
@ActivationConfigProperty(propertyName = "shareSubscriptions",
propertyValue="true"),
@ActivationConfigProperty(propertyName = "clientId", propertyValue =
"MyClientId_1")
})

public class TopicListener2 implements MessageListener, java.io.Serializable

tomee.xml:

  <Resource id="ATOPIC"
                          
class-name="org.apache.activemq.artemis.api.jms.ActiveMQJMSClient"
                          constructor="name"
                          factory-name="createTopic"
                          type="javax.jms.Topic">
        name=ATOPIC
        </Resource>     
mybroker.xml:

     <address name = "ATOPIC">
                    <multicast>
                                                   <queue name = "ATOPIC"/>
                                              </multicast>
               </address>       

My Question: 1Q: With the above code the message is going to both topics.
But i want them to be sent only to a single topic as per the guidelines of
shared subscription.
2Q: there are many long valued or numbers queues being created in the
artemis console. how to stop them from getting created ? why do they get
created ?

Please help.
Thank you








--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Reply via email to