01. juni 2006 - 14:34Der er
13 kommentarer og 1 løsning
Does Tomcat 5.5 support EJB 2.0 and Message Driven Beans?
Hello!
We wonder if Tomcat 5.5 support EJB 2.0 and Message Driven Beans?
Is it possible to create topics and queues in Tomcat 5.5 and let MDB:s listen for incomming messages?
We also wonder if it is possible to create "bridges" like in WebLogic on these queues and topics so that messages posted in tomcat gets forward to say MQ for eg.
A customer just have Licencse for WebLogic 8.1 that supports EJB 1.0
The customer needs a asynchrone integration between WebLogic and WebSphere our suggested solution is JMS and use of MDB:s. But as, I guess told me, MDB:s is only available in EJB 2.0 we got a problem.
The upgrade for a WebLogic license for this customer to be able to use EJB 2.0 is a big investment.
So now we are looking for either other cheaper applicationservers that supports EJB 2.0 or some other solution then MDB:s.
Perhaps JBoss with Tomcat will be the only solution or is there some alternative to a own MDB-implemtation that just need EJB 1.0?
It may sound like this is a stupid idea to try to implement a own solution of MDB.
Thanks for your answer. According to the link in your reply I must say that it seems very strange that our customer says that they do not have a WebLogic Licens of 8.1 that do not support EJB 2.0 and MDB:s. I need to verify this. If thay have license for a WebLogic 8.1 like your link refers to then the problem is solved, right?
How ever I have heard that thay have some cheap licens for WebLogic 8.1 that just supports EJB 1.0. Thats way we got this problem. Unfortunately our projectmanager just accepted to implement an integration based on JMS.
The solution now is looking: weblogic got 2 server instances Server a got a webapp. Server b got a ejbapp with MDB:s
When sometihing happens (a specific database update) on a, b gets notfied via JMS and MDB:s and take care of the task for a.
Assume that the customer just have EJB 1.0 and do not want to invest anything more in licenses, during the night I thought of this solution then without MDB:
weblogic got 2 server instances Server a got a webapp. Server b got a threaded app that every minute checks a queue for new JMS-messages from a. If there is any messages b consumes the messages and performs the tasks for a.
Do you see anything bad with this solution? Using a thread to schedule a task perhaps is bad. Perhaps there is anything built in in appserevers that we could use instaead?
We just did a very quick test for a own home-made solution for MDB:s.
In the JMS-api there is a method "setMessageListener" in the TopicSubscriber interface. We created a Servlet that in the init method does something like this:
properties = new java.util.Properties(); properties.load(new FileInputStream(fileName)); properties.setProperty("java.naming.provider.url", properties.getProperty("protocol")+properties.getProperty("url")+properties.getProperty("port") ); jndiContext = new InitialContext(properties);
Thank you for your very interesting comment. I guess what you say means that my code my be very risky then.
I have to admit that I do not know what or when to use EJB-transactions. Could I ask you to "describe" a very small scenario about it. I just know about JDBC-transactions. Suppose that we should do 2 updates for each received JMS-message. If the second fails we should rollback the first one. Does the EJB-transactions fit in this simple scenario or is it on a higher level thats probaply is new to me?
Not necesarrily risky. It depends entirely on whether your code is depending on EJB transaction support or not. But it is a service that your alternative code does not provide.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.