Checking message in the JMS queue

Hi there,
Is there a way to check the message is in the JMS queue? I tried to use the QueueBrowser. However, it always return me an enumeration = null
when I run the following "QueueBrowser.getEnumeration()". I am using JRun 3.0 application server.
And by the way, how would to know whether the message has been consumed by the receiver in a point to point model? We could still managed to send out messages even when the receiver client is not started. I understand that the receiver client would be able to receive those messages once they are started as the messages are in the queue. However, what if the queue is destroyed (some catastrophic event happen to the JMS provider) before the receiver client is started?

I have no problem using the QueueBrowser:
      QueueConnection qc;
      qc = qcf.createQueueConnection();
      QueueSession session;
      session = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
      QueueBrowser browser = session.createBrowser(queue);
      Enumeration enum = browser.getEnumeration();The used JMS provider must support a persistence mode. When the server is restarted and there were messages in the queue, they are restored.
When receiving messages you can use autoacknowledge mode without transaction which means when receive() is called, the message is deleted from the queue. In transacted mode in addition to receive() you have to call commit() on the session in order to delete the message in the queue.
When using clientacknowledge you have to call message.acknowlegde() after receive().

Similar Messages

  • How to read the messages in the JMS Queue using JMX

    Hi,
              I want to read messages in the JMS queue using JMX. I was able to read using QueueBrowser but want to modify priority of the messages using JMX.
              I tried to use JMSDestinationRuntimeMBean but it does not allow us to read messages unless we pass the message Id. Is there any way that I can get all the messages in the queue.
              I am using Weblogic 8.1 SP4
              Can someone please help me in this regard.
              Thanks,
              Kiran.
              Edited by KGudipati at 10/22/2007 1:22 AM

    Hi,
    As far as i know, JMS Object Messages is not supported by XI JMS adapter.
    you need to have the JMS provider to transform the message to bytes messages.
    (Refer to SAP note 856346)

  • How to keep a back up of messages from the JMS queues?

    Hi,
    I need to keep a back up of messages which are coming in the JMS queue before they get consumed. This is for recovery purpose.
    I checked file store option but it doesnt have any time stamp on messages so dont know how to trace back messges if needed from file store.
    Please let me know if you guys have any idea to handle this.
    Thanks in advance
    Bips

    No. Not with Time Machine at least.
    If you tell Time Machine to backup the external then you will have it.
    Or you can manually copy it to another disk for storage outside of Time Capsule/TimeMachine.
    Allan

  • How to check the jms Queue is persistance or not in jboss application serve

    hi,
    i am using jboss as application server for jms and database is postgres.For an message store i am using the "*database store*".while starting the jms adding queue it is adding the messages to the jms queue after starting the jms receiver the datas are received sucessfully....afte some 10 to 13 hours i am getting java.lang.OutOfMemoryError in jms..so i checked the postgres table space.Table space is increased gradually...I think that the after receiver received that message the messages are not deleted in the database.how to debugg the the secnario in jboss as wel as in database.....how to chaeck the queue is in persistance or not persistance...
    regards.
    naresh govindaswamy.

    Send a request to the server somehow, so that the server is aware of this. AJAX may be very useful in this if you want to do this asynchronously.
    its very urgently This is irrelevant information. That's your problem. We don't care less or more. Some users here will even refuse to help you if you're putting pressure.

  • Read message synchronously from JMS queue using OSB

    Hi,
    Is it possible to read message from the JMS queue using OSB based on the request invocation. I know messages can be read from the queue but it will be polling based.
    The requirement is to have an OSB proxy service (HTTP service ) an an interface to the client application. Client application invokes the proxy service and the proxy service need to read message from the JMS queue and provide the message as response to the client.
    Let me know if there are any pointers.
    Thanks
    Sandeep

    Hi,
    I spent some time trying to do this and apart from creating custom database tables etc. I was not able to achieve this.
    We wanted to use in memory JMS queues in our situation.
    In the end we developed a Java Web Service which preformed the on-demand read from the queue (using a particular message selector)
    This is working for us without a problem
    Robert

  • Messages not making it to the jms queue...

    We are having an interesting problem. AFter a fresh restart of our instnace, it will process a message fine. but, if we wait a few minutes, try another post, the message doesn't get put ot the queue, and it basically hangs the instance.
              I am not sure how to trouble shoot this since there are no errors sent to the logs. the console will show a stuckthread message eventually.
              I was wondering if anyone could help with what are some potential causes, and if there is anyway to get additional information out of the server. I have turned on the debug and set the level to info, but no additional information is getting generated.
              We've done print outs in the code right up to where the failure occurs.
              I"ve posted the code snippet that is being used. It failes when it gets to the code after GQ 5.
              Any help is appreicated.
              public boolean queueMessage(Serializable messageObj, String queueName)
              throws NamingException, JMSException, ResourceKeeperException, Exception {
              EventLogger.log(Level.DEBUG, "Trying to put a message in the " + queueName + " queue in GenericQueue.queueMessage(): ");
              try {
              if (messageObj != null)
              EventLogger.log(Level.DEBUG, "Serializable messageObj in GenericQueue.queueMessage(): " + messageObj.toString());
              else
              EventLogger.log(Level.DEBUG, "messageObj is not serializable");
              Hashtable ht = null;
              boolean inHash = false;
              //check to see if the queue is in the hashtable
              if (queues.containsKey(queueName)) {
              EventLogger.log(Level.DEBUG, "The Queue was in the hashTable in GenericQueue.queueMessage(): ");
              inHash = true;
              ht = (Hashtable) queues.get(queueName);
              else EventLogger.log(Level.DEBUG,"The Queue was not the hashTable using default values in GenericQueue.queueMessage(): ");
              Context ctx = InitialContext.getInitialContext();
              EventLogger.log(Level.DEBUG, "GQ 1");
              QueueConnectionFactory qconFactory = null;
              EventLogger.log(Level.DEBUG, "GQ 2");
              if (inHash)
              qconFactory = (QueueConnectionFactory) ctx.lookup((String) ht.get("jmsFactory"));
              EventLogger.log(Level.DEBUG, "GQ 3");
              else
              EventLogger.log(Level.DEBUG, "GQ 4");
              qconFactory = (QueueConnectionFactory) ctx.lookup(jmsFactory);
              EventLogger.log(Level.DEBUG, "GQ 5");
              QueueConnection qcon = qconFactory.createQueueConnection();
              EventLogger.log(Level.DEBUG, "GQ 6");
              QueueSession qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
              EventLogger.log(Level.DEBUG, "GQ 7");
              QueueSender qsender;
              EventLogger.log(Level.DEBUG, "GQ 8");
              Queue queue;
              EventLogger.log(Level.DEBUG, "GQ 9");
              queue = (Queue) ctx.lookup(queueName);

    The "stuck thread" message is likely a good clue. Force a server thread dump when this occurs. Feel free to post the thread dump here.
              Side note: Make sure the "GenericQueue" method doesn't attempt to multi-thread access to any JMS session, consumer, or producer.
              Tom

  • Program to consume the JMS queue

    Hi, I' m new to WebLogic stuff. Got a question over here. There's a JMS queue that we want to have a program (not those built in stuff from weblogic) to see if they re consumed. Similar stuff would be displayed like
              <b>ABCD Queue consumers: 1 / consumers high: 0 ...messages: 10 / messages received: 19........</b>
              as if we get into the console page to check the JMS queues.
              I've got no clues yet. We don't wanna check the number of files from C:\Original and the destination folder C:\Destin......if so, it'd be an easy task but that s not what we wanted....

    As with any WebLogic subsystem, you can get all statistics programmatically using standard JMX mbeans (see the JMX developer guide). The console uses these beans, as does the WLST scripting language. In addition, there are helper methods in the public weblogic.jms.extensions package that simplify access to these beans.
              I think there are various mbean and WLST samples on dev2dev, including one called "JMSStats.java". Note that JMSStats.java, and some other samples were written for versions 8.1 and earlier. They use deprecated methods that don't have access to all runtime statistics for 9.0 and later versions.
              Tom

  • Multiple Messages in Same JMS queue

    Hello,
    I have interfaces in which different xml messages from the same sender system will be placed in the same MQ queue, is there a way that XI JMS sender channel can differentiate the xml messages based on the payload?
    I can create a single communication channel, but the outbound message interface I cannot create a common structure because the xml messages are huge and there will be future interfaces following the same architecture.
    1. How can I route in interface determination based on the context in the inbound msg interface?
    2. What can I provide as Message interface for the outbound?
    3. MessageSelector attribute in Adapter specific properties - any ideas on this? - I can select this in the condition context in interface determination - can I give any values here to differentiate msges?
    4. Value mapping - is it possible to define the sender message interface through this?
    Any idea is appreciated..THank you..

    Hi Thanujja,
    We have recently completed a project that had this requirement too. We made use of the MessageSelector to solve this problem. You'll need to make use of some advanced (advanced tab)settings in the comm channel. Basically you want to add Additional JMS Message Properties. You can add up to 10 additonal JMS Properties.
    Let's say you've added a property called MESTYP. You then need to get the sender to populate the MESTYP property with a text value for each IDoc involved e.g. DELVRY. You would then set your JMS Message Selector field as follows: MESTYP='DELVRY'.
    You'll have a comm channel for each IDoc. These comm channels will then connect to the JMS Queue & only pick up messages that meet the criteria at set in the Message Selector.
    There was one other problem that encountered with Message Selector, we were on XI version 7.0, the Message Selector was working intermittently & then we applied SAP Note 1256636 & upgraded to 7.01. Everything is working fine after that.
    Trevor

  • Queue up messages in a JMS queue during DB outages.

    I am currently using a MessageDriven EJB that pops messages of a JMS queue and
    then grabs a connection from a weblogic dbpool and process it. However if the
    database is down, the EJB still pops off messages and then throws exceptions when
    trying to get the connection from the pool and the exception is logged and the
    message lost.
    How can i architect the application so that when the db is down the messages are
    queued up in the JMS queue, so that when the DB comes back online they can be
    processed.?

    The $ is not a valid character for an element NAME per W3C standards. In short you can only use letters, numbers and the underscore ( _ )..
    You need to correct this message / data and reprocess the message.
    Setup an Error Queue so these messages get thrown some where that will not cause issues in your system. Then use error handling in something like AIA to report back to your support staff that a bad message was encountered, needs to be fixed and reprocessed.
    You will see that if you do a google search for how to escape a dollar sign in xpath, there are no good results....
    Hope that helps!
    -Luke

  • How to pick(or consume) messages from Woblogic JMS Queue only when DB is UP

    Hi,
    I have a requirement to pick(or consume) messages from Woblogic JMS Queue only when DB is UP.
    When DB is down, messages should remain in queue. When DB is up, messaged should be picked on scheduler basis.
    We are using SOA suite 11g(BPEL or mediator,JMS Adapter).
    What is the best way to achive it in SOA 11g.
    I tried, but when I setup a Consumer, there is no control over there. Messages are picked automatically.
    Please advise.
    Thanks
    Ram

    something wrong with the design.
    why dont you set the retry options in the fault policies?
    So if the external DB is down you could reprocess them after specified interval or make it go to human retry queue.
    Then you could use SOA api to retry all of them.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Is there way to see messages in the JMS in GlassFish?

    I sent message to JMS, but how can I confirm the JMS queue has the message?
    Is there way to see through such as GlassFish console?
    At least I want to see how many messages in the queue.
    Thanks

    I'm not sure about GF console but under $IMQ_HOME/demo/applications/qbrowser there is a qbrowser app that you may find usefull.
    Also there is imqcmd command. You could use it to query the broker and your destinations.
    Tom

  • 10 million messages in one jms-queue

    Hi all,
              we want to put about 10 million jms-messages in a jms-queue with a jdbc
              persistent store on oracle database.
              Does anyone of you made experiences with that much messages in one
              queue? Are there any known limitations concerning the number of
              messages, e.g. according managing overhead, etc?
              Thanks for any comment,
              Klaas

    The $ is not a valid character for an element NAME per W3C standards. In short you can only use letters, numbers and the underscore ( _ )..
    You need to correct this message / data and reprocess the message.
    Setup an Error Queue so these messages get thrown some where that will not cause issues in your system. Then use error handling in something like AIA to report back to your support staff that a bad message was encountered, needs to be fixed and reprocessed.
    You will see that if you do a google search for how to escape a dollar sign in xpath, there are no good results....
    Hope that helps!
    -Luke

  • Sending messages concurrently to JMS queue

    Hi,
    I am using Weblogic 10.3 JMS. I have a .NET producer sending messages to a JMS queue using a threadpool. A Java consumer will be consuming the messages. Is it possible to pool the conections/sessions from the producer side to send messages concurrently from the threadpool. Please help.

    You can use standard .NET threading to produce messages in different threads.
    Keep in mind that producers and session instances themselves must not be multi-threaded, although they can all share the same connection.
    When you code, each thread could have a dedicated session and producer.
    Alternately, you could write a very simple pool that the threads share to cache producers. On the other hand, sessions and producers are light-weight once they've been created, so there's often little need to go through this trouble.
    Tom

  • Error: 28005, Severity: 16, State: 2...An exception occurred while enqueueing a message in the target queue. Error: 15517, State: 1. Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impe

    I've seen some similar questions, but want to make sure I can get an answer quickly and how to fix.
    Thanks,
    Paul
    spid24s     Error: 28005, Severity: 16, State: 2
    spid24s     An exception occurred while enqueueing a message in the target queue. Error: 15517, State: 1. Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated,
    or you do not have permission.

    Hi Paul,
    I also had the same error on one of my servers, and it was because the user that created the database no longer worked for the company.
    So when his AD account got deleted, the database had NULL as owner
    Using the following query I asked for the owners of the databases:
    select name, suser_sname(sid) from master.dbo.sysdatabases
    So changing the owner of the databases that had a NULL owner solved the issue for me.
    use <databasesname>
    go
    exec sp_changedbowner 'sa'
    Thanks for triggering the solution.
    Peter

  • How to view the Messages on the Stream Queues in the MQSeries Explorer

    Hi,
    After you publish the data to the stream queue (SYSTEM.BROKER.DEFAULT.STREAM), how to you see the data on that stream using the MQSeries Explorer.
    I could not see any data on the stream, but I have confirmed that the messages are being published because after I register the subscriber, the published messages do get routed corectly.
    Is there a way to view published messages on the stream queue. any help would be greatly appciated.
    Thanks,
    Rushabh

    Thanks for replying..but what if there are no subscribers registered for that particular topic and the publisher keeps on publishing the messages for a topic. I suspect there should be some way of knowing for the publisher whether it published the messages on the stream queue or not and hence some way of viewing the messages on the queue via the MQSeries explorer..
    Thanks,
    Rushabh

Maybe you are looking for

  • How can I install snow leopard on 2010 MacBook Pro that has no os?

    I purchased a 2010 MacBook Pro on eBay and it was delivered with no operating system. It has disk utility recovery, but the choices listed don't apply. I don't have an time machine backup, nor can I restore Mavericks.  I bought a copy of Snow Leopard

  • Imac network problem in xp

    my imac is unable to connect to wifi in xp whereas it is able to connect in mac . Another interesting point is that this machine connects to wifi in another place i.e in another network in win xp .

  • Restoring Paid Apps that Weren't Back Up on iTunes

    Hello, I need to know how to restore some paid apps back to my iPad that aren't backed up via iTunes on my computer. I purchased and downloaded the apps directly on my iPad and there was a syncing issue and for some reason it completely wiped my apps

  • Register Java Function

    Needed to register custom-defined function in Java on Essbase server. I am following the instructions on <BR><a target=_blank class=ftalternatingbarlinklarge href="http://dev.hyperion.com/download/code_library/exportcdf_readme2.cfm">Custome-defined f

  • Order data

    Hi all, Is there anyway when you create an order it should save that order in xl file in pc or appln server. If possible please tell me how to do it. with regards chandu.