You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Dignesh <dg...@opentext.com> on 2017/02/05 03:58:17 UTC

Deploy MDB(topic) in non clustered way

Hi,
I have a cluster set up with TomEE 7.0.2 with 3 nodes.
I have a MBD (MyTopic) deployed on all the 3 nodes.
What I have observed is Each MDB (MyTopic) that is deployed to a server
instance in cluster environment creates a single JMS connection. - This is
due to the unique deployement id we assign to the bean.So when a JMS message
is raised, all the MDB's deployed in each node receives the message.
So Is it possible to replicate the message on all nodes for some topics
which are deployed ?

I was able to do it by having same clientID assigned to the MDB in all
nodes. - is this is correct ? OR is there any cleaner way to acheive this.
With the above approach I am seeing the alreadyconnected exceptions in the
log.. can this be ignored . OR is there any better way to address this
usecase.

P.S. I dont want to use Queues :) 

Thank you very much.




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Deploy-MDB-topic-in-non-clustered-way-tp4681016.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: Deploy MDB(topic) in non clustered way

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Le 5 févr. 2017 11:06, "Dignesh" <dg...@opentext.com> a écrit :

So does it mean , there is a no way via a configuration were we can restrict
messages being replicated on all nodes. ?


You chose a topic so you requested to distribute the messages to all nodes
explicitely





And how would using another topic will solve the use case.?


If names are different you control the messages. This is more a design
issue i think



I haven't understood what selector is ?


This is a workaround for this kind of design issue specific to JMS. It acts
as a filter on messages. You get all messages but before being passed to
the mdb a selector (condition) is used to filter them.








--
View this message in context: http://tomee-openejb.979440.
n4.nabble.com/Deploy-MDB-topic-in-non-clustered-way-tp4681016p4681020.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: Deploy MDB(topic) in non clustered way

Posted by Dignesh <dg...@opentext.com>.
So does it mean , there is a no way via a configuration were we can restrict
messages being replicated on all nodes. ?

And how would using another topic will solve the use case.?

I haven't understood what selector is ? 






--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Deploy-MDB-topic-in-non-clustered-way-tp4681016p4681020.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: Deploy MDB(topic) in non clustered way

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hmm, why not using another queue/topic or selector?


Le 5 févr. 2017 10:32, "Dignesh" <dg...@opentext.com> a écrit :

> Below is the activation property element configured in my ejb-jar.xml file.
>
> <activation-config>
>                                 <activation-config-property>
>
> <activation-config-property-name>destination</activation-
> config-property-name>
>
> <activation-config-property-value>MyTopic</activation-
> config-property-value>
>                                 </activation-config-property>
>                                 <activation-config-property>
>
> <activation-config-property-name>destinationType</
> activation-config-property-name>
>
> <activation-config-property-value>javax.jms.Topic</
> activation-config-property-value>
>                                 </activation-config-property>
>                                 <activation-config-property>
>
> <activation-config-property-name>clientId</activation-
> config-property-name>
>
> <activation-config-property-value>MyTopicMDB</activation-
> config-property-value>
>                                 </activation-config-property>
>                                 <activation-config-property>
>
> <activation-config-property-name>subscriptionName</
> activation-config-property-name>
>
> <activation-config-property-value>MyTopicMDB_Scub</
> activation-config-property-value>
>                                 </activation-config-property>
>                         </activation-config>
>
> In cluster environment having 3 nodes, Each MDB deployed creates a single
> JMS connection. This is due to the unique deployement id(ClientID) we
> assign
> to the bean.
>
> Now my issue here is when I raise a JMS message, all the mdbs (Topic) in
> each nodes gets the message. I need to restrict the message to be delivered
> to single node.
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Deploy-MDB-topic-in-non-clustered-way-tp4681016p4681018.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>

Re: Deploy MDB(topic) in non clustered way

Posted by Dignesh <dg...@opentext.com>.
Below is the activation property element configured in my ejb-jar.xml file.

<activation-config>
				<activation-config-property>
				
<activation-config-property-name>destination</activation-config-property-name>
				
<activation-config-property-value>MyTopic</activation-config-property-value>
				</activation-config-property>
				<activation-config-property>
				
<activation-config-property-name>destinationType</activation-config-property-name>
				
<activation-config-property-value>javax.jms.Topic</activation-config-property-value>
				</activation-config-property>
				<activation-config-property>
				
<activation-config-property-name>clientId</activation-config-property-name>
				
<activation-config-property-value>MyTopicMDB</activation-config-property-value>
				</activation-config-property>
				<activation-config-property>
				
<activation-config-property-name>subscriptionName</activation-config-property-name>
				
<activation-config-property-value>MyTopicMDB_Scub</activation-config-property-value>
				</activation-config-property>
			</activation-config>

In cluster environment having 3 nodes, Each MDB deployed creates a single
JMS connection. This is due to the unique deployement id(ClientID) we assign
to the bean.

Now my issue here is when I raise a JMS message, all the mdbs (Topic) in
each nodes gets the message. I need to restrict the message to be delivered
to single node.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Deploy-MDB-topic-in-non-clustered-way-tp4681016p4681018.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: Deploy MDB(topic) in non clustered way

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Not sure i get it. There is no link between deployment id of the ejb and
connection number.

The topic name (and type BTW) are activation properties you can configure
whatever EJB name you use.

Is that your case? N different MDB listening the same topic? Then forcing
the destination name and type should work


Le 5 févr. 2017 05:01, "Dignesh" <dg...@opentext.com> a écrit :

Hi,
I have a cluster set up with TomEE 7.0.2 with 3 nodes.
I have a MBD (MyTopic) deployed on all the 3 nodes.
What I have observed is Each MDB (MyTopic) that is deployed to a server
instance in cluster environment creates a single JMS connection. - This is
due to the unique deployement id we assign to the bean.So when a JMS message
is raised, all the MDB's deployed in each node receives the message.
So Is it possible to replicate the message on all nodes for some topics
which are deployed ?

I was able to do it by having same clientID assigned to the MDB in all
nodes. - is this is correct ? OR is there any cleaner way to acheive this.
With the above approach I am seeing the alreadyconnected exceptions in the
log.. can this be ignored . OR is there any better way to address this
usecase.

P.S. I dont want to use Queues :)

Thank you very much.




--
View this message in context: http://tomee-openejb.979440.
n4.nabble.com/Deploy-MDB-topic-in-non-clustered-way-tp4681016.html
Sent from the TomEE Dev mailing list archive at Nabble.com.