Results 1 to 3 of 3

Thread: SubscribableChannel over JMS with filtering subscribers

  1. #1
    Join Date
    Jun 2009
    Posts
    2

    Default SubscribableChannel over JMS with filtering subscribers

    Hi,
    I have a few questions.

    Here is what I want to do:

    I have a server that offers messages of different types over the same SubscribableChannel. The messages shall be transferred via JMS.

    Now I have a bunch of clients running on different computers and each client accepts only one type of message.
    However there may be several clients for the same type of message. Each message
    should only be processed by one client, so I don't want them simply sent to each of
    them but rather have a dispatcher take care of selecting one out of the pool of clients
    that accepts the message type.

    So now as I understand it I can do the following:

    Implement my own AbstractSubscribableChannel with perhaps a RoundRobinDispatcher
    that selects a client by sending a message to the first client in the list and then if a MessageRejectedException. occurs skips to the next one until it finds a client that will accept the message.
    Each client could then register at the channel providing a custom filter that detects acceptable messages and rejects all others.

    Now my first question:
    The messages can easily be several 100kb and as I understand it in my approach they would maybe transmitted several times over the network until a client is found that accepts the message.

    Is this right or does the filter register with the server when the client subscribes to the channel and is executed before the message is sent?

    If I'm right what would be the right approach to handle that scenario?

    Maybe writing my own dispatcher that allows special handlers to register that carry a filter expression with them so that I can do the filtering on the server side?

    Please forgive me if I got something horribly wrong since I'm both new to JMS and SI

    Any help would be greatly appreciated

  2. #2
    Join Date
    Jun 2009
    Location
    Ukraine, Nikolaev
    Posts
    18

    Default

    I think you don`t reely need implement any AbstractSubcribableChannel. You can use standard jms message adapters and filters.

  3. #3
    Join Date
    Jun 2009
    Posts
    2

    Default

    I spend some time with the jms API and have now a better understanding of the whole thing.

    Then found out that Virtual Destinations provided by ActiveMQ do exactly what I need!

    Thanks for your help!

Tags for this Thread

Posting Permissions

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