You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by kbohnenberger <ke...@mantech.com> on 2009/04/14 15:59:23 UTC

switch on JMS property

SNAPSHOT BUILD

Can someone point me to an example of how to switch on a JMS property of an
incoming message?

This is what I have:
    <proxy name="receiveJMSKoList" transports="jms">
        <target>
            <inSequence>
                <property action="set" name="OUT_ONLY" value="true"/>
   	        <sequence key="validateJmsKoList"/>
                <sequence key="filterJmsKoList"/>
                <sequence key="customSendJMSKoList"/>
            </inSequence>
        </target>
        <parameter name="transport.jms.ContentType">
            <rules>
                <jmsProperty>contentType</jmsProperty>
                <default>application/xml</default>
            </rules>
        </parameter>
        <parameter
name="transport.jms.ConnectionFactory">incomingQueueFactory</parameter>
        <parameter
name="transport.jms.Destination">cn=incomingQueue</parameter>
    </proxy>

In the inSequence, I would like to inspect a JMS property like MessageType
and switch based on the value so I can call different sequences for
different "message types."

Any help would be appreciated.

Thanks 

Keith
-- 
View this message in context: http://www.nabble.com/switch-on-JMS-property-tp23039960p23039960.html
Sent from the Synapse - User mailing list archive at Nabble.com.


Re: switch on JMS property

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Keith
> I am looking to switch on user defined properties.
> The publisher of the JMS messages set several user defined properties using
> Something like this:
> (javax.jms.TextMessage) message.setStringProperty(MESSAGE_TYPE, "type1")
>
>
> When I receive the message I would like to inspect the value of the
> MESSAGE_TYPE user defined property and switch on the value.
>   
These are read as transport headers.. so you could do this:

<filter source="get-property('transport', 'MESSAGE_TYPE')" 
regex="type1"> ....</filter>

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





Re: switch on JMS property

Posted by Keith Bohnenberger <ke...@mantech.com>.
I can probably use message selectors and have different listeners for
different message types but ultimately I need to get all the messages, I
just need to follow different business rules for each specific MESSAGE_TYPE
value.


On 4/14/09 12:07 PM, "Keith Bohnenberger" <ke...@mantech.com>
wrote:

> I am looking to switch on user defined properties.
> The publisher of the JMS messages set several user defined properties using
> Something like this:
> (javax.jms.TextMessage) message.setStringProperty(MESSAGE_TYPE, "type1")
> 
> 
> When I receive the message I would like to inspect the value of the
> MESSAGE_TYPE user defined property and switch on the value.
> 
> Keith
> 
> On 4/14/09 11:56 AM, "Asankha C. Perera" <as...@apache.org> wrote:
> 
>> Hi Keith
>>> Can someone point me to an example of how to switch on a JMS property of an
>>> incoming message?
>>> ....
>>> In the inSequence, I would like to inspect a JMS property like MessageType
>>> and switch based on the value so I can call different sequences for
>>> different "message types."
>>>   
>> Can you be specific.. is it a JMS message header?
>> 
>> cheers
>> asankha
> 
> This communication, along with any attachments, is covered by federal and
> state law governing electronic communications and may contain company
> proprietary and legally privileged information.
> If the reader of this message is not the intended recipient, you are hereby
> notified that any dissemination, distribution, use or copying of this message
> is strictly prohibited.
> If you have received this in error, please reply immediately to the sender and
> delete this message.  Thank you.
> 

This communication, along with any attachments, is covered by federal and state law governing electronic communications and may contain company proprietary and legally privileged information.  
If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, use or copying of this message is strictly prohibited.  
If you have received this in error, please reply immediately to the sender and delete this message.  Thank you.


Re: switch on JMS property

Posted by Keith Bohnenberger <ke...@mantech.com>.
I am looking to switch on user defined properties.
The publisher of the JMS messages set several user defined properties using
Something like this:
(javax.jms.TextMessage) message.setStringProperty(MESSAGE_TYPE, "type1")


When I receive the message I would like to inspect the value of the
MESSAGE_TYPE user defined property and switch on the value.

Keith

On 4/14/09 11:56 AM, "Asankha C. Perera" <as...@apache.org> wrote:

> Hi Keith
>> Can someone point me to an example of how to switch on a JMS property of an
>> incoming message?
>> ....
>> In the inSequence, I would like to inspect a JMS property like MessageType
>> and switch based on the value so I can call different sequences for
>> different "message types."
>>   
> Can you be specific.. is it a JMS message header?
> 
> cheers
> asankha

This communication, along with any attachments, is covered by federal and state law governing electronic communications and may contain company proprietary and legally privileged information.  
If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, use or copying of this message is strictly prohibited.  
If you have received this in error, please reply immediately to the sender and delete this message.  Thank you.


Re: switch on JMS property

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Keith
> Can someone point me to an example of how to switch on a JMS property of an
> incoming message?
> ....
> In the inSequence, I would like to inspect a JMS property like MessageType
> and switch based on the value so I can call different sequences for
> different "message types."
>   
Can you be specific.. is it a JMS message header?

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com