aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes MDB in EAR doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "MDB in EAR doubt" Watch "MDB in EAR doubt" New topic
Author

MDB in EAR doubt

vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 218
Hi Ranchers,
I
I am having 2 ear applications(suppose sample1.ear & sample2.ear). Both are having web and ejb modules Both applications are having message driven beans of EJB 3.0. I deployed both of them in IBM websphere 7 server.
My Requirement is , sample1 has ejb session bean which access sample2 message driven bean.
what i did is , i added jar file of sample2.ear to sample1.ear and ran the application .but of no use. Please suggest me to work on this.

Thanks & Regards
vipul


Thanks
Vipul Kumar
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1075
    
  10

Hi Vipul,
A session bean does not 'access' a message driven bean. A session bean can post a message to a topic/queue. If the MDB is registered to listen to this queue/topic, it will pick-up the message and do the processing.
This page from the tutorial shows how a client can send a message to a queue/topic.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 218
Hi Ranganathan,

I didnot meant session bean access a message driven bean. I meant , session bean has IBM MQ server connection and queue connection code. I successfully sent a message to a MDB. But my requirement is different. Please check my post.


Thanks
Vipul Kumar
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1075
    
  10

Hi Vipul,
I re-read your post. I am unable to infer anything different from what I understood earlier. Can you elaborate?
vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 218
Ranganathan Kaliyur Mannar wrote:Hi Vipul,
A session bean does not 'access' a message driven bean. A session bean can post a message to a topic/queue. If the MDB is registered to listen to this queue/topic, it will pick-up the message and do the processing.



This is absolutely right. I am clear with this. My Issue is, In Sample1.ear , iam having a session bean which is sending messages to queue.queue is registered in IBM MQ server. that message has to reach MDB in sample2.ear. will it be possible? In my case iam unable to communicate with two different ears.

Thanks
Vipul Kumar

Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1075
    
  10

If the MDB in the second ear listens to the queue that you are talking about, then, it will pick up the message. It doesn't matter where the message comes from.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MDB in EAR doubt
 
Similar Threads
Interaction between WebApp and Java
problem with the web.xml
Reg XA Driver Configuration
JSF 2.0 MyConverter.getAsObject(...) how to get a handle on the backing bean
hibernate 4 and spring 3.1.2 issue with LocalSessionFactoryBuilder