Message selector on JMSCorrelationID?

I am wondering how to do a selective get on a queue using the JMSCorrelationID field. I can set my own fields for message selectors fine, but I wanted to standardize on this field for simplicity; is there a straightforward way of doing this?

You can be safe from the overwritten field if you make sure that you use the exact format that JMS uses forthe field,
i.e. "ID:<24 bytes>".
If you pass a string of "1234" you should do a search on the receive queue for "ID:313233340000000000000000000000000000000000000000".
Now what I'm trying to figure out is if there is a way to wildcard the
match. I setup mine to have a unique code in front (the string "1234" in case you were curious) then I hash the workstation id, message number, user number and iteration into a unique number (I hope), append that to the above and then pad it out with the right number of zeroes. the problem is other people are also testing in the same queues. After I do my testing I want to clear the queues of just my messages without touching anyone elses (especially the error queue, a lot of junk is left there), or to be able to browse the queues only seeing my messages.
(for the record I'm doing this in Load Runner to control how many users are sending messages and to measure response times).

Similar Messages

  • Using Message Selector w/JMSCorrelationID causes auto-commit

    I'm using the following code to create a session with transactions enabled:
    Session session = connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
    String messageSelector = "JMSCorrelationID = 'myid'";
    QueueReceiver receiver = session.createReceiver(ioQueue, messageSelector);
    When I call receiver.receiveNoWait(), it retrieves the message, but automatically commits it. If I call session.rollback() directly afterward, I don't get any exceptions, but the message is completely removed from the queue (as if I had committed it).
    If I use the same exact code with an empty message selector (""), the rollback works fine all the time.
    Does anyone have any idea why? I'm using MQ v5.3 on W2k.
    Thanks!
    Jeff

    use CLIENT_ACKNOWLEDGE
    Session session = connection.createQueueSession(true, Session.CLIENT_ACKNOWLEDGE);
    );//Session.AUTO_ACKNOWLEDGE);
    from the spec:
    CLIENT_ACKNOWLEDGE - With this option, a client acknowledges a
    message by calling the message�s acknowledge method. Acknowledging a
    consumed message automatically acknowledges the receipt of all messages
    that have been delivered by its session.
    AUTO_ACKNOWLEDGE - With this option, the session automatically
    acknowledges a client�s receipt of a message when it has either successfully
    returned from a call to receive or the MessageListener it has called to process
    the message successfully returns.

  • Experiences using the JMS Message Selector

    I am using a JMS Adapter Sender Communication Channel and try to select the messages I want to consume with the Message Selector. My first attempts all failed - I am not sure if the syntax I am using is correct or if anything else has to be set up to use the Message Selector.
    My sample was to enter the following into the field for Message Selector:
    JMSCorrelationID = '123456789012345678901234'
    I also tried the following variations:
    JMSCorrelationID = "123456789012345678901234"
    JMSCorrelationID = 'ID:123456789012345678901234'
    JMSCorrelationID = "ID:123456789012345678901234"
    but none of them were successful.
    Anybody got that feature to work yet and can help me...
    regards,
    peter

    Now I found it out finally...
    JMSCorrelationID = 'ID:41727469636c655570646174656400000000000000000000'
    where ID: is obviously added by JMS? XI? don't know... and the actually id is in Hex...
    can anybody enlighten me on the details?
    regards
    Peter

  • Message selectors

              Two questions:
              1.) Where does the message selector query get executed? Either every subscriber
              gets all messages for the subscribed topic and then runs the selector against
              it, or the server runs the selector on the message before sending it out to the
              subscriber. While it may seem like the latter is preferable, I wonder how much
              performance on the server side will be affected as a result of the server processing
              ALL of the message selectors. If the former is the case, there is obviously more
              network traffic, but the server's processing time is reduced when many messages
              are sent out to many subscribers with message selectors. Does anyone have any
              input on this?
              2.) Are there any plans for Weblogic supporting subscriptions to a hierarchial
              topic? For example, subscribing to cars.* will return messages sent to the topic
              cars.bmw and cars.ford. I know this is not part of the JMS specification, but
              it is a nice addition.
              Thanks.
              Dan
              

              Tom Barnes <[email protected]> wrote:
              >Hi Dan,
              >
              >Answers in-line.
              >
              >Dan Baumbach wrote:
              >
              >> Two questions:
              >> 1.) Where does the message selector query get executed? Either every
              >subscriber
              >> gets all messages for the subscribed topic and then runs the selector
              >against
              >> it, or the server runs the selector on the message before sending it
              >out to the
              >> subscriber. While it may seem like the latter is preferable, I wonder
              >how much
              >> performance on the server side will be affected as a result of the
              >server processing
              >> ALL of the message selectors. If the former is the case, there is
              >obviously more
              >> network traffic, but the server's processing time is reduced when many
              >messages
              >> are sent out to many subscribers with message selectors. Does anyone
              >have any
              >> input on this?
              >
              >If you use the WL topic multicast extension, the former. The former
              >is the
              >obvious choice using multicast, as the server only has one network call
              >to make per
              >message...
              >
              >Otherwise, the latter. The latter is preferable, as otherwise the
              >server would
              >be making one network call be subscriber per message - which is far more
              >heavy-weight.
              >
              >>
              >>
              >> 2.) Are there any plans for Weblogic supporting subscriptions to a
              >hierarchial
              >> topic?
              >
              >This is under consideration.
              >
              >> For example, subscribing to cars.* will return messages sent to the
              >topic
              >> cars.bmw and cars.ford. I know this is not part of the JMS specification,
              >but
              >> it is a nice addition.
              >
              >Yes, topic hierarchies are not part of the JMS specification, but you
              >can emulate them
              >fairly easily, if somewhat inefficiently, by using JMS selectors with
              >a "like" clause.
              > The publisher sets a correlation-id on the message:
              >msg.setJMSCorrelationID("cars.ford");
              > The subscriber sets its selector to "JMSCorrelationID like 'cars.%'"
              >
              >>
              >>
              >> Thanks.
              >> Dan
              >
              >Tom
              >
              

  • Synchronous operation with a message selector possible?

    I have a situation where the following condition exists:
    - a number of servlet threads (1-n) will post to request to an external asynchronous system with a unique id.
    - the external system will post the responses to a JMS queue.
    - my servlet threads need to receive their - and only their message from the queue
    - my servlet threads need to have timeout
    The problem is, I need the selectivity of a message selector, but also the timeout of a .receive() method.
    I have considered filtering the responses in each onMessage event, but this will not scale well when many responses exist.
    Any recommendations will be appreciated.

    I think I answered my own question. I was confusing a MessageSelector with a MessageListener - two different animals....
    I was able to implement the pub/sub with the following syntax:
    /* the publisher would put the transaction_id (unique id) in the
    JMSCorrelationID field in the message header. */
    message.setJMSCorrelationID(transaction_id);          
    /* The subscriber will only receive messages that match this trans ID. This will be accomplished by adding the following MessageSelector clause to the subscriber session:*/
    String selector = "JMSCorrelationID = '"+transaction_id+"'";
    subscriber = subscriberSession.createSubscriber(topic,selector,true);
    "Astitva" , thanks for the help!

  • JMS Header: JMS Properties and Message Selector

    Hi all
    I´m using a JMS Adapter to consume messages from a JMS queue (a JMS adapter which create the BPEL instance when a message arrives).
    The process must select messages which meet certain criterias, so I´m using Message Selector to filter the messages and only pick up the ones who interest me (If click on the "help" button on JDeveloper Wizard in the page you define Message Selector, you can see an example on how doing this).
    So how can I select messages using values placed on JMS Properties, in the Message Selector?
    For example, I set in the JMS Header:
    JMSInboundHeadersAndProperties
    --------JMSInboundProperties
    ----------------Property
    -----------------------name = 'Country'
    -----------------------value = 'Brazil'
    The JMSAdapter must consume only messages that "Country" = "Brazil".
    Thanks in advance.
    Menezes

    Yes
    I am able to specify JMS Header and JMS Properties when producing a message. However I am not able to user "Message Selector" to filter messages based on JMS Properties information when consuming messages.
    In the link you provide, there is an example on how to use Message Selector:
    # (a copy from the link)
    Message Selector
    ...for example, you can enter logic, such as:
    * JMSType = 'car' AND color = 'blue' AND weight > 2500
    * Country in ('UK', 'US', 'France')
    I believe the example with "Country" is exactly what I need, but I can´t get it work.
    I create the same example above, setting a property named "Country" in the JMSHeader, sending the message to a JMS Queue (BPEL Process #1) and try to comsume it on the Message Selector (BPEL Process#2), but JMSAdapter never consumes the message.
    Thanks for your help.

  • Message Selector and Setting JMS Header Properties PL/SQL Enqueue

    Currently I am attempting to use the Message selector functionality. I just know know exactly how we need to set the property in PL/SQL when enqueuing. I also want to verify the syntax that I should use in the event that I am doing this incorrectly...
    The code I am using to test the enqueue is
    declare
    enqueue_options dbms_aq.enqueue_options_t;
    message_properties dbms_aq.message_properties_t;
    message_handle RAW(16);
    agent sys.aq$_agent := sys.aq$_agent('', null, null);
    message sys.aq$_jms_text_message;
    recipients DBMS_AQ.aq$_recipient_list_t;
    BEGIN
    message := sys.aq$_jms_text_message.construct;
    message.set_text('<ORDER><HEADER_ID>16992531</HEADER_ID></ORDER>');
    message.header.set_string_property('bamfilter','ORDER_ENTRY');
    dbms_aq.enqueue(queue_name => 'XX_OM_MONITOR_Q',
    enqueue_options => enqueue_options,
    message_properties => message_properties,
    payload => message,
    msgid => message_handle);
    COMMIT;
    END;
    we have tried a few other methods, but still to no avail...
    the syntax I believe for the selector in the ems should be bamfilter='ORDER_ENTRY'
    Any help would be great.
    The DB the Queue is locate is on 10g if that makes any difference...

    Yes
    I am able to specify JMS Header and JMS Properties when producing a message. However I am not able to user "Message Selector" to filter messages based on JMS Properties information when consuming messages.
    In the link you provide, there is an example on how to use Message Selector:
    # (a copy from the link)
    Message Selector
    ...for example, you can enter logic, such as:
    * JMSType = 'car' AND color = 'blue' AND weight > 2500
    * Country in ('UK', 'US', 'France')
    I believe the example with "Country" is exactly what I need, but I can´t get it work.
    I create the same example above, setting a property named "Country" in the JMSHeader, sending the message to a JMS Queue (BPEL Process #1) and try to comsume it on the Message Selector (BPEL Process#2), but JMSAdapter never consumes the message.
    Thanks for your help.

  • JMS Adapter Message Selector Problem...

    Hi
    I have set the following in the invoke before producing the message and dropping on the queue
    <invoke name="Invoke_1" partnerLink="adapt"
    portType="ns1:Produce_Message_ptt"
    operation="Produce_Message"
    inputVariable="Invoke_1_Produce_Message_InputVariable"
    bpelx:inputHeaderVariable="Sender"/>
    On the receive side I have the message selector configured for the adapter as follows:
    <jca:operation
    ActivationSpec="oracle.tip.adapter.jms.inbound.JmsConsumeActivationSpec"
    DestinationName="dattjndi"
    UseMessageListener="false"
    MessageSelector="Sender=AdaptationRequest"PayloadType="TextMessage"
    OpaqueSchema="false" >
    </jca:operation>
    Where AdaptationRequest is the value for the Sender variable which will be used to filter the message. But this does not work. the messages are still not consumed. What could be the problem?
    Thanks,
    Anil

    did you check the message selector section on
    http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Message.html
    explains all the operators you can use and the correct syntax. Make a note of the case sensitivity.

  • Trouble using JMS Message Selector and DCJMSMessageProperty0

    Hello Experts!
    My scenario is Mainframe => MQ => JMS Adapter => XI => SAP
    My MQ channel is communicating fine to XI and I've set the JMS adapter to JMS Compliant.
    I have multiple message types with consistent headers but varying data layouts that I need to route to different mapping objects. So it seems the best solution for this is JMS Message Selector based on reading a header value from one of the dynamic message properties.
    I've read SAP Notes and SAP Library and SDN Wiki articles about this configuration and I think its possible.
    http://help.sap.com/saphelp_nw04s/helpdata/en/10/b1b4c8575a6e47954ad63438d303e4/frameset.htm
    Note 856346 - J2EE JMS Adapter: Frequently Asked Questions (FAQ)
    Note 1086303 - XI JMS Adapter and IBM Websphere MQ: FAQ
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/usage%252bof%252bmessage%252bselector%252bfor%252bjms%252bsender%252badapter
    My mainframe sends an MQ message that includes some extra header information like
    field: ApplType  VALUE: 000000002                                              
    field: ApplName    VALUE: MIS056O          
    I configured my Communication Channel to set Adapter-Specific Message Attributes and also Additional JMS Message Properties to include ApplType and ApplName.
    However, I can only see some of the standard JMS header items such as CorrelationID, none of the additional ones.
    In RWB I see "JMS property 'ApplType' that corresponds to dynamic header 'DCJMSMessageProperty0' is missing from JMS message 'ID:f2f0f0f9f0f4f2f1f0f9f1f5f5f3f7f44040404040404040'; consequently it cannot be added to XI message 'e136a6e8-8580-4adc-2007-9ccab93f1ef4' as a dynamic header"
    Can anyone with some experience doing this help me see if I'm missing a trick somewhere? How can I see where this information is being dropped? Could it be when MQ is handing to JMS?
    Many thanks,
    Aaron

    After sifting through some IBM documentation I found that the PutApplName field actually maps to JMS name JMSXAppID. So after adding this to my Additional JMS Message Properties list I get the dynamic JMS message property I need for sorting out the messages.
    http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaw.doc/uj25450_.htm

  • JMS message selector

    hi there,
    any one used JMS message selector field in the JMS sender adapter. I want to filter out messages that are relevant for various interfaces. where do i set the filter value. i read java docs, it says the filter is possible for message header and properties. the weblog on sdn is not exactly clear and it doesn't work either.
    thx

    Ya you can go ahead with it right ??? See it says you can filter on the basis of header info and its properties , so header info will have originating source info. Its worthful to use it that way . Please clarify if i am wrong , i think thats what u require filter msg on basis of interface for what you are using the adapter.
    ref : http://java.sun.com/j2ee/sdk_1.3/techdocs/api/index.html
    ref : http://help.sap.com/saphelp_nw70/helpdata/EN/45/20d245ceff2b35e10000000a1553f7/frameset.htm
    I just tried , see if it helps , or i am wrong in getting your question
    If helpful please award points
    Abhishek

  • JMS Sender adapter Message selector

    Does anyone know of a good blog where someone is showing how to use the JMS message selector option in the JMS sender channel?  I'd like a screenshot of what is actually typed into this field most of all.

    did you check the message selector section on
    http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Message.html
    explains all the operators you can use and the correct syntax. Make a note of the case sensitivity.

  • JMS Message Selector on Message Payload

    Hi,
    I have a requirement where in;
    A JMS adapter consumes messages from an AQ JMS Topic. We need to make selective dequeue from the Topic. Is that possible to make use of the message selector option on the 'message payload'?
    Message selector works on JMS Header and Properties as far as I know.
    Any insight on this would be of great help :-)
    Thanks,
    Manoj Nair.

    It's like almost a month to get a response for such a generic JMS functionality. Looks like the Oracle SOA user base is really low. Anyone with a working example reference.
    Thanks

  • AQ Adapter with message selector rule

    Hi,
    I'm doing a B2B11g implementation on AS2. Incoming messages are processed using the AQ adapter. Now I have several (about 8) AQ-adapter implementations on the IP_IN_QUEUE that select messages using a message-selector-rule based on the DocumentType. So each SOAComposite dequeues and processes the appropriate document.
    This works fine, but I'm looking for any performance recommendations on this.
    What is the impact on CPU for example using message selector rules? Any do's and don'ts on this?
    Thanks in advance.
    Regards,
    Martien

    http://download.oracle.com/docs/cd/B14099_19/integrate.1012/b25307/adptr_aq.htm#CJAEIACG

  • A basic query with respect to using Message Selectors in JMS

    Hi
    When i am going MEssage Selectors topic in web , it seems very confusing for me .
    I have written a simple JMS Application based on Weblogic as my Queue .
    I have two Java Files one for Message Producer and another file acting as Message Consumer using MDB
    I have a basic TextMessage with some header properties in my Producer file .
    Please tell me in what file should i put MessageSelector ??.
    Thanks for reading .
    Please clarify my query on this .

    Thank you very much .
    I found the code of a MDB making useage of a Selector .
    *<message-driven>*
    *     <message-selector>shirtType = 'polo'</message-selector>*
    *     </message-driven>*
    Assume that i written a MDB that listens to particular type of Messages (Polo in this case ) .
    Please tell me what happens to other messages in the Queue that were never listened by the MDB .
    Thank you .

  • Question about Message Selector

    Dear all,
    I have implemented a JAVA progrram which will sent 10 JMS messages into AQ sequentially, and then use another JAVA client which will get JMS message from the AQ.
    I found out that if i use Message Selector to get message from AQ, the message will NOT be read from the queue by enqueue_time, how can i get the jms message from AQ by message selector that can preserve the enqueue_time order?

    Have you got a lot of MTA?
    Because you can create one rule by MTA...
    Example:
    In message filter:
    verylongbloke sayed how do that...
    and in content filter:
    rule1: if (header("X-IP") == "^1.1.1.1$") { alt-mailhost ("[1.1.1.1]"); }
    rule1: if (header("X-IP") == "^1.1.1.2$") { alt-mailhost ("[1.1.1.2]"); }
    It's not very sexy but it works fine...
    unfortunately, we can't use variable for alt-mailhost action... or I don't know how :)
    regards..

Maybe you are looking for

  • Fields in sapscript

    Hi, I have some fields in the sapscript but when one of them is empty the others fields move. So how can I set the length of the field so the others fields don't move. Thanks

  • IPhone 4 with IOS 5 no longer appears as device

    I have 3 iphones, 2 iphone 4 and 1 iphone 3g. I recently updated iTunes to get the new IOS 5. After I updated 1 of my iphone 4, everything worked fine for a couple of days. However, when I tried to update my second iphone 4, iTunes would not recogniz

  • P7N SLI Platinum and power consumption?

    In few day I'll get a Msi P7N SLI platinum to replace my Gigabyte P35,I would like to know the power consumption for 750i? Is lower than 780i? You can see in the picture the 780i 48W and P35 only 16W So big different!!!

  • Help with queries in a JSP to MS Access DB

    I'm trying to use a JSP to query an MS Access database: If I create the following query in MS Access it works no problem: SELECT * FROM EMPLOYEE_VACATION WHERE Department="Laboratory"; If I try to duplicate the query in my JSP as shown below: ResultS

  • Zynq Linux issue with udev

    Hi, I am using "Linux zynq 3.10.0-xilinx". I did checkout of the tag Xilinx v14.7 I have cross compiled the kernel modules. I am using Zynq Z702 board, I have used the booting file for petalinux on Zynq from the below mentioned site. http://www.wiki.