Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMS reliability

 
Raymond Ong
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How reliable are JMS implementations? Can JMS queues hold up to 1 million messages at a time? I have a design problem that I need help with. I have a servlet receiving https requests which I then send out to a JMS queue for consumption by and MDB. The request of course has to be validated. Question is, where do I put the validation of the request parameters? Upon receiving the http receive and before sending to the JMS queue or upon receiving of the message by the MDB? If i validate the request before sending to the JMS queue, can I be sure that the MDB will get exactly the same message the servlet sent or will there be instances that the message might get corrupted thus will be invalid.

Thanks very much in advance
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your reason for thinking that a message might be corrupted?
 
Raymond Ong
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Of course I'm thinking worst case scenario. Are you saying that the messages cannot be corrupted? I need advice so I know where to properly put my validation. On my servlet or on the message-driven bean.

Thanks!
 
Tomasz Luchowski
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raymond Ong:
Hi,

Of course I'm thinking worst case scenario. Are you saying that the messages cannot be corrupted? I need advice so I know where to properly put my validation. On my servlet or on the message-driven bean.

Thanks!


If you put validation logic in a servlet you have a meaningful way of displaying error message... if you do that in MDB it becomes problematic. What kind of validation precisely do you want to perform?
 
Raymond Ong
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It's more of business logic validation. Whether the required request parameters are complete and the values/data/format of the request parameters are valid. If I do the validation on the servlet, then send to request to the MDB, I worry that the request might be subject to corruption (in worst-case scenarios) so I feel that I need to do the validation on the MDB, but doing that will mean that the servlet has to pass each request to the MDB. What I can do is validate the completeness of the required request parameters on the servlet, then pass on the request to the MDB to validate the values of the request parameters.

Any other approach?

Thanks!
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you let the MDB validate user input, how do you communicate to the user that their input was invalid?
 
Raymond Ong
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

That will be done by sending out an HttpPost to another server. This is the design of the system I have to connect with.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic