Problem using Message-Selector

Hi,
out client-application subscribe to a JMS-topic on OC4J (9.0.3) using the following code
TopicConnectionFactory oConnectionFactory = (TopicConnectionFactory) ctx.lookup("jms/MyTopicConnectionFactory");
oConnection = oConnectionFactory.createTopicConnection();
oTopicSession = oConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topic = (Topic)ctx.lookup("jms/MyTopic");
TopicSubscriber sub = oTopicSession.createSubscriber(topic);
Everything works fine.
But when we replace the last line to use Message-Selectors
TopicSubscriber sub = oTopicSession.createSubscriber(topic,"username = 'abc'",false);
we get the following (strange) error (which occurs at excactly that line)
javax.jms.InvalidDestinationException: Invalid topic
The topic can't be invalid, because we could subscribe without Message-Selector. Do I have to modify the topic at the JMS-Configuration? Any ideas?
Thanks,
Gilbert

Hi Gilbert,
The way I've done it is by defining the rule when creating the subscriber in the database (thru DBMS_AQ). The following document might give you some insight.
http://otn.oracle.com/pls/db92/db92.show_toc?partno=a96587&remark=drilldown&word=DBMS_AQ
HTH.

Similar Messages

  • How to use Message Selector in BPEL

    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 .
    But I am not able to get it to work.
    I want JMS adapter to consume messages based on field "MessageID" =1006 in my message.
    So in my message selector I wrote MessageID =1006
    But its not picking up message.Kindly help what am i doing wrong.
    Thanks in advance.
    Karan

    yes it is the message producer who should set the property
    see http://download.oracle.com/javaee/6/api/javax/jms/Message.html the various setXXXProperty(name, value)
    once the message is on the queue, I am not aware of a way to change its properties, unless by consuming it and reposting it modified...
    well if you are really desperate you can write a MDB who consumes all messages without a given property and repost them WITH the property.... better if reposting to a different queue to avoid trouble...

  • 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 .

  • 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.

  • Many topics vs message selectors

    Hi all,
    I have read that Sun recommends using many topics instead of message selectors. The problem in my case is that I need to provide communication between many similar objects (many = probably thousands of them). The simplest solution would be to have one topic and use message selectors, but taking the Sun recommendation into account, I was thinking about creating many topics instead. Can anyone provide me with some information whether there is a limit put on topic number or some recommendation on balancing the number of topics/message selectors? Or maybe I should do some performance tests on my own? The AS I use is Sun Java System Application Server Platform Edition 8.1.
    Thanks for any information!

    Hi all,
    I have read that Sun recommends using many topics instead of message selectors. The problem in my case is that I need to provide communication between many similar objects (many = probably thousands of them). The simplest solution would be to have one topic and use message selectors, but taking the Sun recommendation into account, I was thinking about creating many topics instead. Can anyone provide me with some information whether there is a limit put on topic number or some recommendation on balancing the number of topics/message selectors? Or maybe I should do some performance tests on my own? The AS I use is Sun Java System Application Server Platform Edition 8.1.
    Thanks for any information!

  • 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.

  • 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

  • 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..

  • 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.

  • I have two Iphones with different email addresses sharing one Apple ID. Will that cause problems with using messaging and FaceTime?

    I have two Iphones 5 with different email addresses sharing one Apple ID account.Both are using IOS 8.
    I would like to set up a new Apple Id for one of the phones and remove it from the old account.
    If I do that, can I move all of the purchased apps and songs to the new Apple account?
    Also, will sharing one Apple ID account with two devices cause problems with using messaging and FaceTime?

    Sharing an iCloud account between two devices can be done without causing issues with iMessage and FaceTime, just go into Settings for each of these functions and designate separate points of contact (i.e. phone number only, or phone number and unique email address).  While that works, you'll then face the problem where a phone call to one iPhone will ring both if on the same Wi-Fi network -- but again, that can be avoided by changing each phone's settings.
    Rather than do all that, don't fight it -- use separate IDs for iCloud.  You can still use a common ID for iTunes purchases (the ID for purchases and iCloud do not have to be the same) or you can use Family Sharing to share purchases from a primary Apple account.

  • TS2755 Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help of how to set up messages on each

    Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help on how to set up messages on each device separately and to start using messages app on each device independently. Thanks

    search google for "iphone remove picture from contact"

  • When ever I try to watch any video, from a link or YouTube say, using Firefox, I get a message 'An error as occurred. Please try again later'. It has been this way for some weeks. I don't have this problem using Safari or Opera.

    When ever I try to watch any video, from a link or YouTube say, using Firefox, I get a message ‘An error as occurred. Please try again later’. It has been this way for some weeks. I don’t have this problem using Safari or Opera.

    I believe that our “Werbung problem” adds an additional second hyperlink to the pop-up window. This second link is activated whenever you trigger a saved hyperlink to a Mail.com site.
    I had the same problem and eliminated it by deleting all bookmarks, hyperlinks and automatic links that take firefox to a mail.com address. So I just deleted all bookmarks I had saved for mail.com. I also changed my home page link because it also went to my email at mail.com. I then did a warm boot, opened firefox and re-saved my bookmarks and homepage to the desired addresses. Good luck.

  • I downloaded a application to my iphone5, however when i open the application i receive a message stating that my device clock apperars to be incorrect as a result you may experience problems using this application. How do i fix this issue?

    Im trying to watch a show but because of this message its not allowing me to do so. Again the error message im receiving is " Your device's clock appears to be incorrect as a result you ,ay experince problems using this application" how do i resolve this issue?

    If there are problems with updating or with the permissions then best is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox application and save the disk image file to the desktop
    *Firefox 26.0: http://www.mozilla.org/en-US/firefox/all.html
    *Trash the current Firefox application (open the Applications folder in the Finder and drag the Firefox application to the Trash) to do a clean (re-)install
    *Install the new version that you have downloaded
    *https://support.mozilla.org/kb/Installing+Firefox+on+Mac
    Your personal data is stored elsewhere in the Firefox profile folder, so you won't lose your bookmarks and other personal data when you uninstall and (re)install Firefox.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox

  • Until recently I was able to send images in the body of my Yahoo emails. Now, I am getting the message "This message has been truncated", and the email does not go through. I do not have this problem using IE. Could you please help? Thank you.

    Until recently I was able to send images in the body of my Yahoo emails. Now, I am getting the message "This message has been truncated", and the email does not go through. I do not have this problem using IE. Could you please help? Thank you.

    Try this -> http://support.apple.com/kb/TA38632?viewlocale=en_US

Maybe you are looking for

  • How to Populate the JTable Object programatically with SQL Results

    I'm wondering if someone could help me on how to populate the JTable Object with SQL Results wherein the Row of tjhe JTable object is automatically adjusted depending on how many records you have queried. Thanks in advance and God bless! (",) * frmMa

  • IPhoto crashed after pressing Buy Book

    Hi, My friend has just spent a few hours designing a book in iPhoto 6 on my OS X Powerbook running 10.4.8, I attemtped to consolidate all my photos in just the iPhoto library recently but for some reason it has made aliases of all my files and not ac

  • Specifying Event Queue for EventQueue.invokeAndWait().

    Javadoc says EventQueue.invokeAndWait(Runnable runnable) / invokeLater are static methods causing the Runnable executed in the system event queue thread. But I found that my applet appli. running under IE has 3 event dispatching threads AWT-EventQueu

  • HT1338 Upgrading software to use the cloub

    I have a MAC OSx version 10.5.8 and i am trying to upgrade the software  to set up iCloud.  I can't seem to figure out how I upgrade the 10.5.8 to the 10.7.4 or later, and there does not appear to be any automatic upgrades available for my system. An

  • Model using the DB Link

    Hi, My source & Target are both Oracle DB. I have a DB Link from my Target DB to Source DB to access the Data. I created 2 Data Servers in my Topology. In my Source Data Server I gave the DB link name against the 'instance/dB Link '. When I reverse E