This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Regarding onMessage() call of an MDB  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am very new to MDB�s. I want to do a simple check for a connection to my backend before executing the onMessage() method of my MDB.

Is there any way by which I can prevent the EJB container from calling the onMessage(). Basically I want to execute the onMessage() only if my check condition passes. The logic should be some thing like below:

if(Connection.status == running){
onMessage(){}
}

Do we have any facilities to do some think like above? Or else what I want to do is to check the connection condition inside onMessage() call and I want to block the further processing of the messages in the queue, some thing as shown below:

onMessage(){
if(Connection.status == running){
// Process further
}else{
// Block further processing and also the calls to onMessage() by the container
}
}

Any body who know how to do the below:

1.I want to execute the onMessage() only if my check condition passes.
2.How to block further processing of the onMessage() by the EJB container till my condition check passes

Thanks & Regards
-Sandeep
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you can control how the EJB container should invoke the onMessage().

What about if you do something like this:
 
Sandeep K M
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Freddy,

Thanks for your reply. The application in which i am trying to achive this is an asyncronous system where in putting message to the queue is done in one flow i.e. outbound flow and processing message is done in a another flow i.e. inbound flow.

So i cant check the condition before putting the messages in to the queue. What i want to do is to block the execution of the onMessage() until my condition passes.

If you have any other idea to implement it? that will be very great
 
mooooooo ..... tiny ad ....
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!