Announcement Announcement Module
Collapse
No announcement yet.
Using wire-tap on chain Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using wire-tap on chain

    Hi,

    I am using Spring integration for "synchronous messaging" with tibco.

    I confiugred the same like below:

    Code:
    <channel id="dynamicQuerySenderChannel"/>
        <channel id="dynamicQueryMarshaledSenderChannel">
            <interceptors>
                <wire-tap channel="processMessageStatusChannel"/>
            </interceptors>
        </channel>
    
        <channel id="dynamicQueryRecieverChannel">
            <interceptors>
                <wire-tap channel="processMessageStatusChannel"/>
            </interceptors>
        </channel>
        <channel id="dynamicQueryMarshaledRecieverChannel">
            <queue/>
        </channel>

    Code:
    <si-xml:marshalling-transformer id="dynamicQueryMarshalingTransformer"
                                        marshaller="dynamicQueryMarshaller"
                                        input-channel="dynamicQuerySenderChannel"
                                        output-channel="dynamicQueryMarshaledSenderChannel"
                                        result-transformer="dynamicQueryResponseTransformer"/>
    
        <jms:outbound-gateway id="dynamicQueryOutboundGateway"
                              request-channel="dynamicQueryMarshaledSenderChannel"
                              request-destination="dynamicQuerySenderQueue"
                              connection-factory="dynamicQueryConnectionFactory"
                              reply-channel="dynamicQueryRecieverChannel"
                              explicit-qos-enabled="true"
                              time-to-live="10000"
                              receive-timeout="60000"
                />
    
        <si-xml:unmarshalling-transformer id="dynamicQueryUnmarshalingTransformer"
                                          input-channel="dynamicQueryRecieverChannel"
                                          output-channel="dynamicQueryMarshaledRecieverChannel"
                                          unmarshaller="dynamicQueryMarshaller"/>
    I have some wire-tap's on my marshalled channels to store the message sending into the database.

    As the above configurations looks little big I am planning to use <chain> for the same:

    Code:
    <chain id="dynamicQuery"
               input-channel="dynamicQuerySenderChannel"
               output-channel="dynamicQueryMarshaledRecieverChannel">
    
            <si-xml:marshalling-transformer marshaller="dynamicQueryMarshaller"
                                            result-transformer="dynamicQueryResponseTransformer"
                                            output-channel="dynamicQueryMarshaledSenderChannel"
                    />
            <jms:outbound-gateway request-destination="dynamicQuerySenderQueue"
                                  connection-factory="dynamicQueryConnectionFactory"
                                  explicit-qos-enabled="true"
                                  time-to-live="10000"
                                  receive-timeout="5000"
                                  reply-channel="dynamicQueryRecieverChannel"
                    />
    
            <si-xml:unmarshalling-transformer unmarshaller="dynamicQueryMarshaller"/>
        </chain>
    now the chain works fine "marshalling", "unmarshalling" and sending and receiving the message, but I am not able to write the "wire-tap" in between inside my chain.

    Can any one help me configuring the "wire-tap" in side the "chain"?

    Thanks for the help,
    arcsri

  • #2
    any alternatives

    Hi,

    Please let me know if any alternative approach to acheive this?

    Thanks

    Comment


    • #3
      The idea behind "chain" is that it provides a convenience for a linear flow across multiple components where you don't care about the channels. Even though internally it still does use channels, they are "implicit" - really an implementation detail. In effect, there's just a chain of MessageHandlers being invoked one after another. So, this means the chain itself is a "black box" if you will. If you actually do care about the boundaries between individual components within that chain, then you should probably break up the chain and add explicit channels between them. If you are happy thinking of that linear flow within the chain *as if* it were just a single composite endpoint, then keep the chain but don't think about there being channels between each handler

      Does that clarify things a bit?

      By the way, if you do have explicit channels, you can apply interceptors (including WireTap) globally based on channel name pattern-matching. That alone can reduce the amount of configuration significantly (and make it easier to switch the interceptor functionality off and on with one change).

      Hope that helps.
      -Mark

      Comment

      Working...
      X