aspose file tools*
The moose likes Spring and the fly likes Spring+MDB+JMS+MQ+xml architecture Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring+MDB+JMS+MQ+xml architecture" Watch "Spring+MDB+JMS+MQ+xml architecture" New topic
Author

Spring+MDB+JMS+MQ+xml architecture

Heartin Kanikathottu
Greenhorn

Joined: Oct 25, 2009
Posts: 3
Could anyone help me in deciding the best approach for implementing an application as below:

A request ( xml ) is provided to a handler, which calls specific java class, which inturn get data from backend and prepare the reponse xml and send it back ( xml ). I need to know how I can organise this app into controller, domain and service layers. Siince there is no jsp I believe we won't have a view.

The request xml will be recieved by an MDB and the response xml will be sent back using JMS template.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

"heartin jacob"

Please click on the My Profile link above and change your display name to meet the JavaRanch Naming Policy of using your real first and real last names.

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

Sounds like a perfect Spring application.

Spring Framework for setting up your service and repository/dao classes for the business logic that is not related to the UI or transport layer being used.

Then with Spring Web Services you can map an XML file to a Service class method. You can use something like JaxB and map your domain object to the incoming xml and also response outgoing xml. Or Axis or XmlBeans. Then your service is now exposed via Web Services.

With Spring Remoting you can expose you services to RMI, HttpInvoker, or Goucho and I forget the other name.

With Spring MVC you can expose your services to the Web, via Controllers and jsp pages.

The main thing is that the Service layer is identical and doesn't change regardless of where you want them exposed.

Mark
Heartin Kanikathottu
Greenhorn

Joined: Oct 25, 2009
Posts: 3
Thanks for the quick reply.

My real name is Heartin Jacob Kanikathottu ( visit www.heartin.in for my original profile ) Anyway I have updated my name to Heartin Kanikathottu.

Yes, I will be using Spring Framework for setting up my service and repository/dao classes for the business logic that is not related to the UI or transport layer being used. But I should put only getting data related things in service layer and put business logic in domain layer right?

Also not clear on how other pieces will fit together.

I will make things more clear.

We have a current MQ based ejb application that has an MDB getting the xml request, give the request to a handler and then the handler decides which java class to call based on a parameter. This specific java class will then get data from backend, create response xml and send it back.

My new requirement has to implement the same with below constraints.

1. Need to use message driven beans ( MDB ) for getting data.
2. Need to use spring JDBC template for getting data from backend in form of hash maps.
3. Need to create response xml by populating data from that hash maps.
3. Need to use JMS template for sending data back.

I don't want to use web service here as it is MQ based. So what is the best solution for an MQ based application mentiones above.

Any help is highly appreciated.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

" But I should put only getting data related things in service layer and put business logic in domain layer right?"

Business Logic belongs in the Service classes/Service layer, not the domain layer. Domain/Repository/Dao layer is just for the queries, where your JdbcTemplate is being used.

For Spring, there is a Listener container that you can use to point to your MDB. Look into Spring Pojo MDBs. With the listener you can also hook up the JMSTemplate to requests and responses.

Mark
Heartin Kanikathottu
Greenhorn

Joined: Oct 25, 2009
Posts: 3
Thanks Mike...

My requirement had initially said to use MDB for receiving request and JMS Template for sending back response. I believe there are some performance difference between MDB and MDP.

Anyway I will look into this and get back...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring+MDB+JMS+MQ+xml architecture