Results 1 to 5 of 5

Thread: message-driven-channel-adapter and jms channel?

  1. #1

    Default message-driven-channel-adapter and jms channel?

    Whats the difference betweeen these two configs (or is there one)?

    Code:
    	<int-jms:channel id="exampleChannel" connection-factory="connFactory" queue="inQueue" message-driven="true" />
    Code:
    	<int-jms:message-driven-channel-adapter id="jmsIn" connection-factory="connFactory" destination="inQueue" channel="exampleChannel"/>

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Have you read this:
    http://static.springsource.org/sprin...e/#jms-channel
    and this
    http://static.springsource.org/sprin...hannel-adapter

    Don't get me wrong, the reason why I am asking is if it is not clear from the documentation we would like to know what is not clear so we can improve.

  3. #3

    Default

    Oleg, I have read and re-read so many times that I think I am confusing myself. If I read correctly, JMS channels, are really on useful when performing async messaging within the same application. Messaging between two SI apps are probably better serve by an outbound-channel-adapter on one side and a message-driven-channel-adapter. Would that be save to say?

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Well, yes you are correct.
    However the interesting thing is that you can accomplish async communication even without JMS, by simply configuring a channel as an Executor Channel http://static.springsource.org/sprin...ingle/#channel

    So the question is really about wether you need to have JMS in between, One of the use case could be *reliability* where you may have persistent JMS destination which can guarantee that the message will not be lost.

    Another use case could be that the JMS destination is a Topic which would mean you can have another external subscriber also retrieving that message etc...

    Let me know if that clarifies.

  5. #5
    Join Date
    Apr 2011
    Posts
    1

    Default

    I believe there is one significant difference between a jms:channel and a pair of ordinary int:channel and jms:outbound-channel-adapter.

    If the intention is to fire and forget (e.g. using wire-tap) a message to the JMS backed channel, following configuration will not work if there is no listener (e.g. jms:message-driven-channel-adapter) available at the time message is sent to the channel:

    Code:
    <jms:channel
    	id="logger"
    	queue="logQueue"
    	message-driven="false"
    />
    It will throw ChannelResolutionException exception:

    Code:
    org.springframework.integration.support.channel.ChannelResolutionException: no output-channel or replyChannel header available
    I believe this is not always the desired behavior since JMS messages might be consumed later and/or by different process. In order to avoid this exception, you a pair of ordinary int:channel and jms:outbound-channel-adapter is needed:

    Code:
    <int:channel id="logger"/>
    <jms:outbound-channel-adapter
    	channel="logger"
    	destination="logQueue"
    />
    Since message-driven attribute of jms:channel is not documented, I would expect setting it to true should not even set the channel to pollable, but also not to require JMS listener.

    The difference between jms:channel and jms:outbound-channel-adapter shall definitely be underlined in the documentation along with an explanation of message-driven attribute of jms:channel.

Posting Permissions

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