Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems using Message Driven Beans

 
Vijay Chandran
Ranch Hand
Posts: 186
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends,

I am using Websphere Application Server 6.1 and RAD 7.0 (J2EE 1.4, EJB 2.0)
I deployed two EAR files EAR1 and EAR2 both having different jar files.

I have used MDB in both the EAR files.
Whenever i put a message in the queue, i want the MDB EAR 1 only to be triggered. But, in my case alternate messages trigger the MDB in EAR 2.

I still have two different Queue Connection Factories,Queues and Activation Specifications for both the EARs.

Please provide me in solving this problem.
Regards,
Vijay
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34179
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijay,
If you have two different queues, the second ear shouldn't be picking it up as they would use different queue names or ports. if you have two pointers to the same queue, there could be a problem though.
 
Vijay Chandran
Ranch Hand
Posts: 186
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Jeanne & friends,

Thanks for the reply. I am sure that there are no same pointers to the queue because, alternate messages correctly come into EAR 1 application.

May be my explanation wasn't clear.

The scenario of my problem is
Suppose there are 5 messages and i want all the 5 messages to be processed only by EAR 1 then, the following happens: My MDB must only call an EJB in EAR 1.


Message Queue -> MDB1 -> EAR 1 ->Receives Message 1

Message Queue -> MDB1 -> EAR 2 ->Receives Message 2

Message Queue -> MDB1 -> EAR 1 ->Receives Message 3

Message Queue -> MDB1 -> EAR 2 ->Receives Message 4

Message Queue -> MDB1 -> EAR 1 ->Receives Message 5

The EJB in EAR 2 is having different java programs. I want my MDB to call only the EJBs in EAR 1.

Hope this is clear. Please provide your help.

Thanks & Regards,
Vijay
 
Shailesh Kini
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Vijay,

Let me understand your scenario. You have MDB's in both EAR1 and EAR2. You want the messages to be consumed by the MDB's either in EAR1 or EAR2. In short you are clustering your MDB's in 2 different EAR files. Now all your business logic is embedded in EJB's that are deployed only in EAR1. You want all the MBD's to make calls to EJB's in EAR1... right?

Is this what you are trying to do? If yes, then in my opinion you will have to make remote calls to your EJB's i.e get a remote reference to your EJBObject and call the business methods. Your MDB's in EAR2 are just like any other java client trying to access EJB's, which has to be done through a remote reference.

Let us know if this helps.
 
Anna Madhusudhanan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
;-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic