Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: MDB-like functionality

  1. #11
    Join Date
    Sep 2004
    Location
    Boston, US
    Posts
    130

    Default

    I just downloaded the ActiveMQ 1.5 distribution. I see another sample in the distribution under modules/spring/src/test/org/codehaus/activemq/spring.

    Seems like the difference between the two is that the sample you pointed me to uses a JCA adapter while this version is the simple non JCA version.

    Comparing the simple solution to the JCA solution, you said :

    * pooling of MessageListener instances so that multiple messages can be processed in parallel (e.g. if you want to process messages on a queue, you might wanna process them in parallel, using 1 MessageListener per thread or something)
    What if my consumer message listener in the simple version is stateless and does not require any synchronization? Like receive message and insert message data in a database. Multiple messages should be processed in parallel. Please correct me if I'm missing something.

    The simpler version is ,well, simpler compared to the JCA version and I would prefer to use it if it meets my needs.

    Thanks,
    Sanjiv

  2. #12
    Join Date
    Aug 2004
    Location
    London
    Posts
    164

    Default

    BTW humblest apologies, the 1.5 release didn't include the latest greatest JCA stuff, we'll be doing a new release fairly soon...

    The nice thing about the JCA version is it handles pooling of connections & sessions; whether you use a single stateless MessageListener or not.

    If you want to avoid JCA, you could write some Java code to create N connection, sessions and consumers and register your MessageListener that way; but its a fair amount of work & would be a fixed size; with JCA you can let the pool size grow & shrink with load.

    Note if you create multiple consumers on the same sesssion via the JMS API, messages are only dispatched one at a time.

    In terms of resources (threads, sockets, RAM etc) the most efficient way of consuming messages in parallel is via JCA as it does some clever things under the covers (e.g. using ServerSessionPool) as well as handling acknowledgement, JMS transactions and XA. Though by all means go for the simple route if you prefer; before the JCA container came along I often did the same on projects
    James Strachan
    ------------------
    Open Source Integration
    Iona

Similar Threads

  1. Replies: 3
    Last Post: Jun 8th, 2010, 03:27 AM
  2. Replies: 3
    Last Post: Jan 21st, 2009, 06:02 AM
  3. Replies: 4
    Last Post: Sep 20th, 2005, 11:08 AM
  4. Replies: 1
    Last Post: Aug 26th, 2005, 06:46 PM
  5. Web transaction token functionality
    By klr8 in forum Architecture
    Replies: 4
    Last Post: Jul 30th, 2005, 06:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •