JMS/AQ: Setting properties for JMS message using PL/SQL

I have created a procedure in PL/SQL that uses JMS messages, and now I need to include a property so that the subscriber can use a message selector to filter out unwanted messages. Is this possible using PL/SQL?
A previous post said: "... But you can have properties in the message payload itself and also define selectors on the message content ...". But I looked at Sun's tutorial and there it said: "A message selector cannot select messages on the basis of the content of the message body."
I have 300 different screens and messages apply only to one screen at a time. When the user is looking at screen 'A' I want him to only recieve messages that apply to screen 'A'. I thought I would do this with message selector, but is there any other way?
Here is my code(borrowed from an earlier post)
PROCEDURE ENQUEUE_JMS_MESSAGE AS
BEGIN
DECLARE
Enqueue_options DBMS_AQ.enqueue_options_t;
Message_properties DBMS_AQ.message_properties_t;
Message_handle RAW(16);
User_prop_array SYS.AQ$_JMS_USERPROPARRAY;
Agent SYS.AQ$_AGENT;
Header SYS.AQ$_JMS_HEADER;
Message SYS.AQ$_JMS_TEXT_MESSAGE;
Message_text VARCHAR2(100);
BEGIN
Agent := SYS.AQ$_AGENT('',NULL,0);
User_prop_array := SYS.AQ$_JMS_USERPROPARRAY();
Header := SYS.AQ$_JMS_HEADER( Agent, '', 'aq1', '', '', '', User_prop_array);
Message_text := 'Message 1 from PL/SQL';
Message := SYS.AQ$_JMS_TEXT_MESSAGE(Header, LENGTH(Message_text), Message_text, NULL);
DBMS_AQ.ENQUEUE(queue_name => 'tstopic',
Enqueue_options => enqueue_options,
Message_properties => message_properties,
Payload => message,
Msgid => message_handle);
END;
END;
-Christer

Thanks for the answer. I managed to set the Correlation id and retrieve it using getJMSCorrelationID(). But I did not manage to use the MessageSelector on it. I have used the Topicbrowser which is not part of the JMS standard? I tried to enqueue the messages using Java too and tried to use the topicbrowser on both JMSCorrelationID and user defined properties withou success. Is there some special requirements of the TopicBrowser?
Enumeration messages;
oracle.jms.TopicBrowser browser =tsess.createBrowser(topic, "TS", "JMSCorrelationID = 'TST'");
int count = 0;
messages = browser.getEnumeration();
if(messages.hasMoreElements())
System.out.println("message"); //never executed
dtxtmsg = (TextMessage)(tsub1.receiveNoWait()) ; //returns a message
String corrID = dtxtmsg.getJMSCorrelationID(); //returns: TST
Thanks for your help so far...it would really save my day if you have some ideas on this too!
-Christer

Similar Messages

  • Programmatically setting UserPrefs for User Messaging Service

    Hi,
    do anyone knows or have tried to set UserPrefs, for User Messaging Service in SOA Suite, instead of using the web interface?
    I have tried using the API provided, but with no success.
    Appreciate any pointers and hints.
    Thank you
    yee thian

    I solved this... when u r saving from Em it is not saving ur configuration. so go to driverconfig.xml file at below location
    Manully enter all the configuration values and restart the server.
    C:\Oracle\Middleware\user_projects\domains\ofmw_base_domain\config\fmwconfig\servers\bam_server1\applications\usermessagingdriver-email\configuration

  • How to set value for Dropdown control using Querystring filter wepart

    Hi,
    I have a dropdown in my customized list form and need to set the value for the dropdown control using query string filter web part.
    I am able to set value for textbox control using Query String Filer web part.
    But, since the dropdown values are not populated on form load, the value is not set for dropdown control.
    How to load the values in dropdown control on form load and set a value using Query String filter webpart?
    Thanks,
    dhijit

    Hi,
    According to your post, my understanding is that you want to filter choice field using Query String Filter web part.
    To filter using query string filter web part, we can set the default value for the choice field in the query string filter web part panel as below, then connect to the list.
    Now it would be filter by the value you have set.
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to set CORS properties for BLOB Storage using node?

    Hi - I just got started with Azure using a Node-based web site and mobile services.
    I am following various documentation in order to provide an API for users to upload images via a time-restricted SAS for the BLOB Storage.
    In order to upload my image, I need to set the CORS configuration for the BLOB Storage. Unfortunately this cannot be done via the management portal.
    I'm unclear as to how to accomplish this. I'm considering using the startup.js file in my mobile service to make a post request to the BLOB Storage REST API:
    http://msdn.microsoft.com/en-us/library/windowsazure/hh452235.aspx
    Are there appropriate methods in the Node SDK to make this easier, especially the signing part?
    What is the recommended way for setting CORS properties for the BLOB Storage via Node?
    Thanks for your help
    Stefan

    Unfortunately Node SDK does not support CORS functionality yet. Your option would be to write code which consumes the REST API for setting CORS. Not sure if it helps but there's a free tool out there written by my company which you can use to set CORS
    on your storage account. More information about this tool can be found here:
    http://blog.cynapta.com/2013/12/cynapta-azure-cors-helper-free-tool-to-manage-cors-rules-for-windows-azure-blob-storage/
    Hope this helps.

  • JMS sender adapter issue for encrypted message

    Hello Folks,
    We have JMS to AS2 interface facing issues when JMS sender channel read the encrypted files placed in MQ queue, messages size is
    increasing to almost double when it reaches PI.
    When sending an encrypted message from MQ to AS2, message is showing in success flag but inbound file size is increasing almost double the size, when compared to message size placed in the MQ Queue. When partner is decrypting the message he is getting total garbage values. But it working fine for unencrypted messages,we are getting the same size as it is in MQ queue.
    Can you please trrough some light on the issue not getting excatly issue is in MQ or JMS sender adapter.
    Kind Regards
    Praveen Reddy

    Hi Praveen,
    the issue seems to be with your encryption/decryption mechanism rather then JMS adapter. if you have encrypted file in JMS queue then channel only pick the file and sent to target (i am assuming there is no tranformation). So it will not alter the file size.
    Please check how the file is encrypted before it places in JMS queue.
    regards,
    Harish

  • Setting OOF for other users using EWS

    Hello everyone,
    I try to set the OOF for other users using EWS in an Exchange 2010 SP2 environment.
    I use this code:
    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
    service.Credentials = new NetworkCredential("username", "password", "domain");
    service.TraceEnabled = true;
    service.TraceFlags = TraceFlags.All;
    service.AutodiscoverUrl("[email protected]");
    OofSettings OOFSettings = new OofSettings();
    OOFSettings.ExternalAudience = OofExternalAudience.All;
    OOFSettings.ExternalReply = "Test";
    OOFSettings.State = OofState.Enabled;
    service.SetUserOofSettings("[email protected]", OOFSettings);
    The account I use is a Service Account our Exchange Team set up. I can see all service properties, so I would assume that the connection to the ExchangeService works fine.
    However when SetUserOofSettings executes, I receive a ServiceResponseException “Connection did not succeed. Try again later”.
    What am I missing? Unfortunately, the error message does not provide any helpful informations.
    Thank you and best regards
    Julian

    >The account I use is a Service Account our Exchange Team set up. I can see all service properties, so I would assume that the connection to the ExchangeService works fine.
     What rights have they given the account, giving an Account Exchange Admin permissions won't give you any rights to access the Mailbox content. For this to work the account you using would need to be either have been granted Full Access via Add-MailboxPermission
    or been given Application Impersonation rights (if its the later you need to make sure you use impersonation in your code).
     I would suggestion you try using the EWSEditor
    http://ewseditor.codeplex.com/ to test this out eg try connecting to the users folders and then try the OOF operation via the EWSEditor option to see if this works.
     Other things to check is if this is a Brand new mailbox that has never been connected to before then the Mailbox folders won't be initialized (you can check this using Get-Mailboxstatistics) and you would get an error trying to perform any of
    the EWS operations. If it works on some users and not others the possibly your getting throttled.
    Cheers
    Glen

  • API to access and set properties for MP4 files

    I am looking for some APIs in Visual C++ to use in Visual Studio to set
    and get properties for .mp4 files. Can anyone help me in this regard?

    Hi Rahul,
    Try using the Windows Media Format SDK with help from the below document:
    http://blogs.msdn.com/b/tims/archive/2004/03/28/extracting-metadata-from-windows-media-files.aspx
    Alternatively, you can give a try to ffmpeg libraries for a open source alternative.
    https://www.ffmpeg.org/download.html
    (Please mark as answer if this solves your query. Please upvote if this reply is helpful).
    Regards,
    Rajesh Nath

  • Cannot undo for deleted messages - using gmail

    When I delete an email message using the Mail application I cannot go to the edit menu and choose undo.  It does not allow me to choose this option.  At one point I was able to do this, but I must have changed some settings in trying to get my email to sync properly.  I read a post on the web that said the gmail imap setting should be set auto expunge off- wait for the client to update the server.  I did do this and also chose move the message to the trash in the gmail imap settings.  Any input in what I can do resolve this issue woould be greatly appreciated.  Thanks in davance.

    You must delete the account on your iPhone and recreate the account as a POP account.
    When recreating the account, don't choose the Gmail account preset.
    Select "Other" instead and then POP as the account type - entering the required account setup information for accessing the account as a POP account.

  • IMAP setting flags for DSN message problem

    Hi,
    I have a question about processing DSN flags using Java Mail.
    We are trying to set SEEN and FLAGGED flags also for DSN messages (for any other messages it is working perfectly fine).
    The problem is that no flags are set, no IMAP commands are issued.
    For any 'normal' messages the IMAP command is issued (for example: A27 STORE 13 +FLAGS (\Seen)).
    We are using Exchange Server 2007 with IMAP support enabled on the mailbox.
    The strange thing is that i can manualy set SEEN and FLAGGED flags from Outlook on this DSN message and then print flags for this message from Java Mail.
    Is there any standard for FLAG processing for DSN messages? Is this a problem in Java Mail / Exchange or some limitation? As I believe DSN in also a javax.mail.Message from the implementation point of view...
    Regards

    Hi Bill,
    This was a good point, about calling setFlags method on the wrong message.
    The problem is because, we are dealing with Exchange bug described here:
    BODYSTRUCTURE with "multipart" "signed" not parsing
    and using workaround described here:
    http://www.oracle.com/technetwork/java/faq-135477.html#imapserverbug
    However, we were setting flags on message created using following code
    SharedByteArrayInputStream bis =  new SharedByteArrayInputStream(bos.toByteArray());
    MimeMessage cmsg = new MimeMessage(session, bis);not on original message from the mailbox.
    Regards

  • Setting Properties for a USB Device

    I am using LabView to manipulate a live video feed that is being supplied by a USB device.
    One device, a DVC100 (http://www.pinnaclesys.com/PublicSite/us/Products/Consumer+Products/Dazzle/Dazzle+Video+Archiving/Dazzle+DVD+Recorder.htm) works perfectly, as long as I set the correct input (S-Video or composite) through a secondary program.  I have tried the IMAQ USB Property Page.vi, but it does not access the input selection of the device, it does allow adjustment of some other useful features.  The secondary program is NOT device specific, it is a cheap video recording program, much like Windows Movie Maker, which allows for the same input adustment.
    I would like to be able to do this IN the vi that I have written, but I am not sure how to access the dll/driver to set the values.  I have written something in Visual Basic before using LabVIew that was able to talk to the driver to set the input value.  Is there an add-on or special vi that needs to be used to access the driver settings?
    I have another USB device, a Pinnacle HD Pro Stick (http://www.pinnaclesys.com/PublicSite/us/Products/Consumer+Products/PCTV+Tuners/PCTV+Analog_Digital+PVR/PCTV+HD+Pro+Stick) that has yet to work with my vi due to the same issue as above:  I need to set the driver with specifics of the capture device.  Unfortunately, setting the information in a secondary program, like above, does NOT work with this device.  I believe the reason is that along with the input selection, this time there is antennae, cable, S-Video and composite, but on top of this is the frequency for the antennae and cable.  The error I get from LabView is the following:  Error -1074396024 occurred at IMAQ USB Grab Setup.vi Error system.
    Is there something I can do in LabView directly, or is this something where I have to make a secondary program in something else to do these adjustments?
    Rich

    Hi rbergs,
    You can use the Call Library Function Node.vi in LabVIEW to make calls to the driver dll for the device. If you have made calls to the driver dll in VB, this should be pretty similar. Please look at this DevZone article for details on using this VI.
    Hope this helps.
    Jaidev
    National Instruments
    LabVIEW Embedded Product Support Engineer

  • SETTING PROPERTIES FOR A MAPPING VIA OMBPLUS ISN'T WORKING

    Hi, i have a problem with OMBPLUS:
    I have a script which creates a mapping and then is supposed to change properties for the mapping and seems to do so via OMBRETRIEVE. But when looking in OWB the properties aren't changed.
    If I change any of the properties inside OWB and then run the script again, then the properties are changed. Does anyone know why the behavior is like this?
    /thanx Joel
    When running the script the output looks like this:
    CREATE MAPPING 'XXX_1_IN'... DONE
    DEFAULT_OPERATING_MODE={SET BASED FAIL OVER TO ROW BASED}
    ALTER MAPPING PROPERTIES FOR 'T_A_TEST_XXX_1_IN'... DONE
    DEFAULT_OPERATING_MODE={SET BASED}
    -- ALL DONE --
    The script:
    set temp_module "TMP"
    set tmp_table1 "XXX_1"
    set tmp_table2 "XXX_2"
    set map_name "XXX_1_IN"
    puts -nonewline "CREATE MAPPING '$map_name'... "
    OMBCREATE MAPPING '$map_name' \
    ADD TABLE OPERATOR '$tmp_table1' BOUND TO TABLE '../$temp_module/$tmp_table1' \
    ADD TABLE OPERATOR '$tmp_table2' BOUND TO TABLE '../$temp_module/$tmp_table2' \
    ADD CONNECTION \
    FROM GROUP 'INOUTGRP1' OF OPERATOR '$tmp_table1' \
    TO GROUP 'INOUTGRP1' OF OPERATOR '$tmp_table2'
    OMBCOMMIT
    puts "DONE"
    set prop [OMBRETRIEVE MAPPING '$map_name' GET PROPERTIES (DEFAULT_OPERATING_MODE) ]
    puts "DEFAULT_OPERATING_MODE=$prop"
    puts -nonewline " ALTER MAPPING PROPERTIES FOR '$map_name'... "
    OMBALTER MAPPING '$map_name' \
    SET PROPERTIES (DEFAULT_OPERATING_MODE) \
    VALUES ('SET BASED')
    OMBCOMMIT
    set prop [OMBRETRIEVE MAPPING '$map_name' GET PROPERTIES (DEFAULT_OPERATING_MODE) ]
    puts "DEFAULT_OPERATING_MODE=$prop"
    puts "-- ALL DONE --"
    puts ""
    OMBDISCONNECT

    Thanks for your idea Roman, but it doesn't solve my problem.
    The problem is regardless of which property (Runtime parameters in OWB) I try to change. Before ANY property is changed via OWB (GUI) the changes via OMB doesn't come to effect (even if RETREIVE after OMBCOMMIT says so).
    Regards, Joel

  • SETTING PROPERTIES FOR A MAPPING VIA OMBPLUS ISN'T WORKING (OWB10gR2)

    Hi, i have a problem with OMBPLUS:
    I have a script which creates a mapping and then is supposed to change properties for the mapping. The script worked in previous releases of OWB but after upgrading to 10gR2 I get an error that DEFAULT_OPERATING_MODE property does not exist.
    Does anyone know why I get the error?
    /thanx Joel
    When running the script the output looks like this:
    CREATE MAPPING 'XXX_1_IN'... DONE
    DEFAULT_OPERATING_MODE={SET BASED FAIL OVER TO ROW BASED}
    ALTER MAPPING PROPERTIES FOR 'T_A_TEST_XXX_1_IN'...
    OMB02902: Error setting property DEFAULT_OPERATING_MODE of T_A_TEST_XXX_1_IN: MMM1034: Property DEFAULT_OPERATING_MODE does not exist.
    -- ALL DONE --
    The script:
    set temp_module "TMP"
    set tmp_table1 "XXX_1"
    set tmp_table2 "XXX_2"
    set map_name "XXX_1_IN"
    puts -nonewline "CREATE MAPPING '$map_name'... "
    OMBCREATE MAPPING '$map_name' \
    ADD TABLE OPERATOR '$tmp_table1' BOUND TO TABLE '../$temp_module/$tmp_table1' \
    ADD TABLE OPERATOR '$tmp_table2' BOUND TO TABLE '../$temp_module/$tmp_table2' \
    ADD CONNECTION \
    FROM GROUP 'INOUTGRP1' OF OPERATOR '$tmp_table1' \
    TO GROUP 'INOUTGRP1' OF OPERATOR '$tmp_table2'
    OMBCOMMIT
    puts "DONE"
    set prop [OMBRETRIEVE MAPPING '$map_name' GET PROPERTIES (DEFAULT_OPERATING_MODE) ]
    puts "DEFAULT_OPERATING_MODE=$prop"
    puts -nonewline " ALTER MAPPING PROPERTIES FOR '$map_name'... "
    OMBALTER MAPPING '$map_name' \
    SET PROPERTIES (DEFAULT_OPERATING_MODE) \
    VALUES ('SET BASED')
    OMBCOMMIT
    puts "-- ALL DONE --"
    puts ""
    OMBDISCONNECT

    Hi, don't look at the script it was copied and pasted from an old thread. The problem is the error I get when trying to execute:
    OMBALTER MAPPING 'map_name' \
    SET PROPERTIES (DEFAULT_OPERATING_MODE) \
    VALUES ('SET BASED')
    OMB02902: Error setting property DEFAULT_OPERATING_MODE of map_name: MMM1034: Property DEFAULT_OPERATING_MODE does not exist.
    //Joel

  • SMLets Beta 3: Unable to set DateTime for DateTime property using SetSCSMObject

    Hello,
    I need to set dateTime for my custom fields for Incidents. I wanted to use Set-SCSMObject for that. But it doesn't work. For other field types it is working fine.
    May be I'm doing something wrong, but I don't see it. It would be great if anybody is able to help.
    This is the command I'm trying to run: (I used CreatedDate for my tests)
    Get-SCSMObject -Class (Get-SCSMClass System.WorkItem.Incident$) -Filter "ID -eq IR495" | Set-SCSMObje
    ct -Property CreatedDate -Value [datetime]"06/08/2011 14:08"
    Set-SCSMObject : String was not recognized as a valid DateTime.
    At line:1 char:104
    + Get-SCSMObject -Class (Get-SCSMClass System.WorkItem.Incident$) -Filter "ID -eq IR495" | Set-SCSMObject <<<<  -Proper
    ty CreatedDate -Value [datetime]"06/08/2011 14:08"
        + CategoryInfo          : ObjectNotFound: ([datetime]06/08/2011 14:08:String) [Set-SCSMObject], FormatException
        + FullyQualifiedErrorId : Could not assign date ,SMLets.SetSMObjectCommand
    Thank you
    Oliver

    Hello,
    You must temporary change locale in your script.
    In begin of script you must change locale in "En-Us":
    $OldCulture = [System.Threading.Thread]::CurrentThread.CurrentCulture
    $OldUICulture = [System.Threading.Thread]::CurrentThread.CurrentUICulture
    $culture = New-Object System.Globalization.CultureInfo("en-US")
    [System.Threading.Thread]::CurrentThread.CurrentCulture = $culture
    [System.Threading.Thread]::CurrentThread.CurrentUICulture = $culture
    And return locale after script body:
    [System.Threading.Thread]::CurrentThread.CurrentCulture = $OldCulture
    [System.Threading.Thread]::CurrentThread.CurrentUICulture = $OldUICulture
    This has solved my issue.  You have no idea how much this has made my day.
    I'm in Australia trying to update/create/close incidents to a canadian server.  Nothing else has worked so far, except this.  The rest of the support/forums on this issue have been crap to say the least.
    It would be nice if MS mainlined the SMLets into SCSM and start actually making their product useful

  • Computer keeps Configuring and setting up for first time use

    I have a toshiba A505-S6980 that has been working fine for a couple years.  Recently I had performance issues and suspected virus, spyware so I did a recovery with the original discs I made when I first got the computer.  Four of the six discs reloaded fine.  It did not ask for the last two discs "Environment 64 bit and Applications and Drives.  I also have a System Repair disc.  After loading the four recovery discs the computer now keeps recycling between preparing for first time use, configuring system, reboot and then back to preparing for first time use,etc.  I think I'm close to getting this, but need a last bit of help.
    Thanks

    It's been a couple days since you posted this problem. Did you get anywhere, or are you still stuck in that loop? If it's still stuck, you may just want to perform the recovery again.
    - Peter

  • Mainframe data loaded into Oracle tables - Test for low values using PL/SQL

    Mainframe legacy data has been copied straight from the legacy tables into mirrored tables in Oracle. Some columns from the mainframe data had 'low values' in them. These columns were defined on the Oracle tables as varchar2 types. In looking at the data, some of these columns appear to have data that looks like little square boxes, not sure but maybe that is the way Oracle interprets the 'low values' in the original data into varchar. When I run a select to find all rows where this column is not null, it selects these columns. In the results of the select statement, the columns appear to be blank, however, in looking at the data in the column using SQL Developer, I can see the odd 'square boxes'. My guess is that the select statement is detecting that something exists in this column. Long story short, some how I am going to have to test this legacy data on the Oracle table using Pl/Sql to test for 'low values'. Does anyone have any suggestions on how I could do this????? Help! The mainframe data we are loading into these tables is loaded with columns with low values.
    I am using Oracle 11i.
    Thanks
    Edited by: ncsthbell on Nov 2, 2009 8:38 AM

    ncsthbell wrote:
    Mainframe legacy data has been copied straight from the legacy tables into mirrored tables in Oracle. Not a wise thing to do. Mainframe operating systems typically use EBCDIC and Unix and Windows servers use ASCII. The endian is also different (big endian vs little endian).
    Does anyone have any suggestions on how I could do this????? As suggested, use the SQL function called DUMP() to see the actual contents (in hex) of these columns.

Maybe you are looking for

  • Solved: Delete Using Automatic Row Processing

    See Scott's reply below for the answer. Hi there, I have an application built in APEX 3.0.1 that I would like to be able to use a button to delete a single row from an underlying database table (owned by the parsing schema). My APEX page has a 3 HTML

  • Thumbnail images in bins

    I am developing a sequence that is comprised principally of freeze frame images taken from video clips.  I am saving all these freeze frames into a separate bin in the Browser.  I have created a 'Thumbnail' column so I can readily identify and grab t

  • Basic ?'s from a new mp3 owner (zen

    )Is my zen V 2gb? mp3 player battery memory or no memory. No memory means I don't have to worry about losing capacity if I recharge when battery is less than fully discharged. 2)How can I check to see how much recording capacity I've used and how muc

  • Why is AFP so slow?

    Yesterday I needed to exchange a document (about 2 MB) over the internet. We tried filesharing using AFP by using 'Connect To Server' in the Finder. We cancelled the transfer and I started FTP in Sharing. After connecting using 'Connect To Server' in

  • Help - Lights and screen are flashing--won't shut down

    Hi: I'm pretty certain this PB Ti has seen its last day. The last time I started it up, it didn't start, but kept spinning (the hard drive) up and down. Now, it won't shut down. Even a force shutdown won't kill it. If there is any power to the comput