2 Replies Latest reply on Apr 1, 2011 2:11 AM by Tim Coninx

    message passing through underlying db

    Tim Coninx Newbie



      We are using a system where three jboss servers with the same application are connected to the same db. The servers are not clustered, but rather serve different audiences.


      Currently we are having a problem with our jms subsystem because a queue fills up too fast because messages are causing exceptions. Normally each server will process its own messages, but because we sometimes have to restart all servers (while a queue is still filled), they suddenly all three start processing all messages that are (at that point) in the db at the same time, meaning that the number of messages failing triples.


      Now we want to have a dedicated (fourth) server to handle all messages. That one will be the only one with activated message driven beans. The messages will still be published however by the three other servers.


      My question: is this possible, and how ? Because normally a message published by one server will never be processed by another server on the same db (unless the message is left in the db and the server restarted). Passing the messages through the messagesucker seems a bit farfetched, as the messages are already in the correct tables.


      We're also not (directly) looking for clustering the servers... although this might become the first step


      I accept 'rtfm' answers, but I'd like a general chapter to read then


      Thanks in advance



        • 1. message passing through underlying db
          Ryan Hochstetler Newbie



          If you really have three JBoss Messaging instances pointed at the same exact database tables, I think this is considered an "out of spec" configuration.  Each independent, non-clustered JBoss Messaging instance requires sole access to the underlying database tables.  (Clustered JBM's understand that they share the tables with other nodes and are configured with a unique identifier that prevents them from seeing messages from other nodes).  If you are going to run three or four independent JBM instances, you might consider giving each JBM instance it's own login credentials and create all of the messaging tables under the default schema for each credential.


          You cannot pass messages with the DB, to my knowledge.  JBM doesn't appear to requery the DB.  It just assumes that since it is the only thing modifying those tables, the tables are consistent with its internal state, where it keeps all messages it is currently processing.  For the most part, it issues INSERTs and DELETEs, rarely SELECTs, except at boot to get the initial working set, or when you've exceeded a queue's FullSize.  DB message passing saves less work than you think if you mentally draw the sequence diagram for each scenario.


          Why not just have Nodes 1 through 3 send messages directly to Node 4?  Instead of looking-up the ConnectionFactory on the local JBoss, look-up the ConnectionFactory on JBoss 4, and the rest of your code should function as expected.

          • 2. message passing through underlying db
            Tim Coninx Newbie

            This solution, one node playing the dedicated JMS server, is the one we actually decided to implement.


            Thanks a lot for the confirmation