• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Spring+MDB+JMS+MQ+xml architecture

 
Author
Posts: 18
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Author
Posts: 18
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
" 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
Author
Posts: 18
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
reply
    Bookmark Topic Watch Topic
  • New Topic