• Post Reply Bookmark Topic Watch Topic
  • New Topic

MDB - onMessage()

 
Manik Kothan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to know how to forward the message available inside the onMessage() of a MDB to another java class in some other project.
 
Jesus Angeles
Ranch Hand
Posts: 2069
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
re: another class on another project



On another server on another machine?

Is it another ejb? What kind of ejb?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use JMS to send the message. Another class which implements the javax.jms.MessageListener interface will be able to process the message.
 
ManikandanJava KothandapaniJava
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jesus Angeles:
re: another class on another project



On another server on another machine?

Is it another ejb? What kind of ejb?


The another class here means a normal java class in an ordinary java project in the same server.

See for example i have an MDB in an EJB proj called 'MDBEJB'. I need to pass the message available in the onMessage() of the MDB to a normal java class residing in another normal java project or a class in another web project, in the same server.
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"ManikandanJava KothandapaniJava"

Please check your private message for a message from JavaRanch.
 
Jesus Angeles
Ranch Hand
Posts: 2069
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ManikandanJava KothandapaniJava:


The another class here means a normal java class in an ordinary java project in the same server.

See for example i have an MDB in an EJB proj called 'MDBEJB'. I need to pass the message available in the onMessage() of the MDB to a normal java class residing in another normal java project or a class in another web project, in the same server.


Some of the options:
1) socket
2) rmi
3) ejb mdb or session
4) servlet over http
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!