Tpdequeue rollback vs message ordering in queue

Hello
I am trying to adopt tuxedo queue subsystem to my application. I have a tuxedo queue created with command:
qcreate -d persist dummySvc fifo none 9999999
When I enqueue (TPNOFLAGS) three messages foo1, foo2 and foo3 I can dequeue them in order foo1, foo2, foo3.
But I need this (fifo) ordering also when I sometimes rollback dequeue operation:
enqueue foo1 -> commit
enqueue foo2 -> commit
enqueue foo3 -> commit
dequeue, I get foo1 -> rollback
dequeue, I get foo2 (I want foo1 again!) -> commit
dequeue, I get foo3 -> commit
dequeue, I get foo1 -> commit
ordering: foo2, foo3, foo1 instead of foo1, foo2, foo3
What you can see above is that foo1 jumped out of order because of application rollback.
How can I configure tuxedo queue and/or enqueue and dequeue functions to ensure that when
I rollback dequeue operation the rolled back message will be still first message to dequeue next time?
checked on tuxedo: 11.1.1.2.0 Patch Level 022 and 129 on Aix 6.1 64 bit

When I've been testing this issue with two simple services: svcEnqueue and svcDequeue, calling them from script+ud32 (sometimes forcing it to fail and rollback dequeue operation) I noticed that when I make sleep >=1 second after each rollback then It results with valid ordering. Sleep is issued in bash script
outside transactions and queue operations.
bad ordering:
dequeue with commit (got foo1)
dequeue with commit (got foo2)
dequeue with fail (got and rolled back foo3)
dequeue with commit (got foo4)
good ordering:
dequeue with commit (got foo1)
dequeue with commit (got foo2)
dequeue with fail (got and rolled back foo3)
sleep outside transaction at least one second
dequeue with commit (got foo3)
Is it a bug? how can I be sure that tuxedo (TMQUEUE?) finished it work related to rollback and I can safely dequeue message with proper ordering?

Similar Messages

  • Unable to receive notifications of new messages arriving on queue

    I was wondering whether any AQ experts out there could help me....
    I have an Oracle AQ queue and a .net service which listens and dequeues messages from the queue. The .net service is written (using ODP.net) to execute a poll of the queue upon startup (in order to process anything on the queue initially), and thereafter to hook into the relevant ODP.net event (happens to be OracleAQQueue.MessageAvailable) such that anything that subsequently arrives on the queue gets dequeued.
    Now, before you tell me to head off to the odp.net forum, I will add very quickly that we have this code in both DEV and TEST environments and it works fine. The queue happens to be a multiple-consumer queue, so the service subscribes as a particular consumer and everything hangs together. My problem is that we promoted all this code to LIVE a couple of days ago and although we are able to dequeue messages no problem we are no longer receiving MessageAvailable notifications.
    Now, I come from a .net background and am 100% sure that the .net code on our Live servers is the same as the code on our Test servers, save for the connection string. So I believe that the problem is more database- or queue-config-related than software-related.
    I do not have a high degree of Oracle knowledge in this area but what I can say is that when we start our .NET service, it is happily able to do the initial poll of the queue and to dequeue any messages. So this says to me that, fundamentally, we're not far off. i.e. it isn't anything really dumb like the queue doesn't exist in the live environment! It is purely that the MessageAvailable event never fires.
    I guess my question is fairly open, then. Given what I have said, can anyone think of reasons why this could happen?
    Things I have already thought of include:
    - different versions of ODP drivers. Not so, I supervised their installation myself on each environment.
    - firewall on the Live database blocking comms? I mean, presumably there is some tcp/udp comms going on underneath the MessageAvailable subscription. I don't believe this to be the case but if anyone knows where I can find out in more details how this works I'd be grateful, if only because it would allow me to ask more specific questions of the DBAs/Server admins
    - my initial hunch was that it was something with the consumer not being set up fully (the .net code uses the consumer name to register both to dequeue messages and to subscribe to MessageAvailable notifications). Not I am told that this is not the case and that the consumer has been set up properly, but I'm still a little suspicious.
    Anyway, any help would be gratefully received.
    Pete

    Hi Pete,
    Together we may be able to work this out ... I have a good level of knowledge on the database side of AQ but know nothing about ODPAQ :)
    Have you seen the following documentation section? Could there be some restrictions on the production host on the ports?
    Oracle Data Provider for .NET opens a port to listen for notifications. HA events, load balancing, and database change notification features also share the same port. This port can be configured centrally by setting the database notification port in an application or Web configuration file. The following example code specifies a port number of 1200:
    <configuration>
    <oracle.dataaccess.client>
    <settings>
    <add name="DbNotificationPort" value="1200"/>
    </settings>
    </oracle.dataaccess.client>
    </configuration>
    If the configuration file does not exist or the db notification port is not specified, then ODP.NET uses a valid and random port number. The configuration file may also request for a random port number by specifying a db notification port value of -1.
    The notification listener, which runs in the same application domain as ODP.NET, uses the specified port number to listen to notifications from the database. A notification listener gets created when the application registers with OracleAQQueue.MessageAvailable event. One notification listener can listen to all notification types. Only one notification listener is created for each application domain.
    Thanks
    Paul

  • Message Ordering or Singlton Service in SOA Suite 11g

    In SOA Suite 10g, JMS Adapter could behaviors as Singleton instance by setting the properties "XclusterGroupId".
    In addition, set Routing Service to be Synchronous execution, therefore only one instance consuming the Target message queue sequentially.
    Does this properties still take effect in SOA Suite 11g, as I didn't find this properties being mentioned through Adapter Technology documentations?
    Otherwise are there any other solutions for the Message Ordering?
    Thank you in advance.
    -Simon
    Edited by: user8408910 on Jul 13, 2009 1:31 AM

    Is it the same answer for JMS topic listeners? i.e. each new message on the topic should be processed once and only once by a Composite deployed to a cluster with >1 server instances.
    Thanks for info,
    Todd

  • A bug in message pattern's queue implementation?

    Here is how to reproduce the problem.
    Have 2 Java program ready.
    A is to create a queue and publish 3 messages to the queue.
    B is to subscribe to the same queue and try to get all messages from the queue (put the getMessage inside a while(true) loop) then wait for new message.
    Step 1. Run A, which put 3 messages into queue.
    Step 2. Run B, which get 3 messages out of the queue then waiting on the getMessage() blocking call.
    Step 3. Kill program B without unsubscribe() call.
    Step 4. Run A, which put 3 messages into the queue again.
    Step 5. Run B, this time it only get 2 messages. The 1st message A put in on Step 4 got lost.
    Actually, if you run Step 2 multiple times before step 3, you will lost more message. It seems each time when there is a subscription created without a unsubscribe(), it will get one message lost.
    I know the propery way is to call unsubscribe(), but the JVM could be killed thus won't have time to do cleanup.

    Using message pattern 2.3, command pattern 2.3 and common 1.3
    Coherence version is 3.4.2.
    BTW, if the unit test program you mentioned is the MessageTests.java included in the src zip file, you won't be able to test this issue.
    All unit test inside the MessageTests.java are comsuming exactly number of messages been published then do unscribe() call.
    In order to reproduce this issue, you'd need to put your consumer JVM in a blocking getMessage() state (i.e. call getMessage() while there is no message in queue)
    then kill the JVM. The unit test codes in MessageTests.java never enter blocking wait state when call getMessage().
    Example code -
    For the one putting message
    MessagingSession messagingSession = DefaultMessagingSession.getInstance();
    Identifier topicIdentifier = messagingSession.createQueue("test-queue");
    messagingSession.publishMessage(topicIdentifier, "Hello WorldY1");
    messagingSession.publishMessage(topicIdentifier, "Hello WorldY2");
    messagingSession.publishMessage(topicIdentifier, "Hello WorldY3");
    messagingSession.publishMessage(topicIdentifier, "Hello WorldY5");
    messagingSession.publishMessage(topicIdentifier, "Hello WorldY5");
    messagingSession.publishMessage(topicIdentifier, "Hello WorldY5");
    messagingSession.publishMessage(topicIdentifier, "Hello WorldY5");
    messagingSession.publishMessage(topicIdentifier, "Hello WorldY5");
    messagingSession.publishMessage(topicIdentifier, "Hello WorldY5");
    messagingSession.publishMessage(topicIdentifier, "Hello WorldY1");
    messagingSession.publishMessage(topicIdentifier, "Hello WorldY2");
    messagingSession.publishMessage(topicIdentifier, "Hello WorldY3");
    For the one getting message
    MessagingSession messagingSession = DefaultMessagingSession.getInstance();
    Identifier topicIdentifier = messagingSession.createQueue("test-queue");
    Subscriber subscriber = messagingSession.subscribe("test-queue");
    while (true) {
    String message = (String)subscriber.getMessage();
    System.out.println(message);
    }

  • SXMB_MONI message fail causing Queue struck at SMQ2

    Hi All,
    If mapping error occured in SXMB_MONI, corresponding entry will be struck up in SMQ2 and saying that SYSFAIL.
    When i drill down this into further, it is saying that Mapping error.
    Because of this all messages coming later also getting strucked in this queue.
    Why is this happening and what to do for not to get struck further messages
    Regards

    Hi Hetal,
    >>Create a job which will restart message after some time if it is stuck because of connection problem or something, then queue will be clear.
    It's because of Mapping problem, even though we schedule a job to restart, it won't resolve. again it comes into same error.
    @Prateej: 
    >>Could you check the QoS for the following entry in SXMB_MONI? Is it EOIO ?
    QOS is Exactly Once
    @Madu:
    >>This is the standard behavior of PI. When some message will fail in Integration Engine(either because of Receiver not found or mapping error),some of remaining message(not all messages) which will come in the same queue of failed message will stuck.
    You can not predict which messages will stuck and which messages will not stuck.
    YES, you are right.
    >>If you are having some important interface, which you want to divert the messages in other queue. You apply exactly once in order in sender channel for other interfaces so that these messages will not stuck in SMQ2.
    For me all are Important Interfaces only. I can't prioritize
    I think the better solution is Monitor failed messages in MONI every day and if it is failed because of Mapping error means, we can delete that entry from SMQ2.because for mapping related errors we don't require that message to restart again.
    so that nothing will be queued after wards.
    Regards

  • Rollback of Messages in OSB

    I have a usecase as below -
    jms.Q1 (nonxa) -- [ proxy service -- publish to a jms.Q2 (xa) -- raise an error ]
    A proxy service receives request from non-xa queue (Q1) ,
    then the proxy service publish that message to another queue (Q2) via XA enabled business service (i use connection factory as XA) ,
    then i raise an error in the message flow.
    What i need is, I want to rollback the message which i published to "Q2" once i raise an error in message flow.
    Can anyone please help me out whether this is possible by using any of the routing option,etc..?
    Regards
    Sesha

    Configure these:
    1. Enable the option Same Transaction For Response in the Proxy Service configuration.
    2. Use QoS as Exactly Once in the publish action which calls the JMS business service.
    3. Use XA connection factory for connection between businsss service and target JMS Queue
    4. Make sure that the error reaches System Error Handler. To ensure this you need to make sure that the flow does not encounter any Reply action after the Raise Error action you have configured in the message flow.
    Once you configure like above:
    1. Message will be deleted from source queue as soon as OSB Proxy picks up the message (since this is not XA enabled)
    2. Message will be published to target JMS queue but not committed till the message flow is completed. So it can rollback in case there is an error after the publish action.
    3. If based on a condition a Raise error action is executed (or any other error happens in the flow) message will be rolled back from target queue in case the error reaches the System Level error handler. So message will not be present in neither source queue nor the target queue.

  • JMS destination key used for message ordering not working

    Hi there,
    i'm using Weblogic 10.3. I've been trying to implement ordering of messages using a destination key assigned to a JMS message queue. The default ordering is FIFO (it uses the JMSMessageID in ascending order for this).
    According to documentation (http://download.oracle.com/docs/cd/E12840_01/wls/docs103/ConsoleHelp/taskhelp/jms_modules/destination_keys/ConfigureDestinationKeys.html) one can also configure the queue to behave in a LIFO manner by creating a destination which sorts on the JMSMessageID in a descending order.
    I have tried this, it does not work. I have also played with different message priority settings and tried to sort on the JMSPriority field of the messages in ascending and descending order, it changes nothing. Messages keep being processed in a FIFO manner.
    Has anyone been able accomplish message ordering other than FIFO? Am I missing something?
    Any assistance would be highly appreciated!

    Why not try
    if (_key.keyPressed(TAB)) then
    -- DO WHATEVER CONDITION
    end if
    im not sure if that is the correct way of telling the system
    to use the TAB key but this works for RETURN when the user hits the
    enter key, so if u substitute the TAB for the command to use the
    TAB key im sure it will work
    im sorry if it doesnt tho, but its worth a try if your still
    struggling

  • Did anyone tried Rejection Message Handler via Queue based method?

    Dear All,
    I am presently doing a Rejected Message Handler process and successfully implemented with File based and Web Service based. But I am not getting the clue for Queue based. We can enqueue the rejected message into queue as a JMS message via this method. But the URI format they have given is *"jdbc:oracle:thin:@<host>:<port>:<sid>#<un>/<pw>#queue"*. Format includes jdbc connection string along with queue name. For this I have created JMS module with JDBC Persistent store and created queue in it. But still I am not able to enqueue the message inside the queue. Also, is there anyway to see the queue names inside the DB. Did anyone tried this method? Could you please share the info??

    WL JMS Queue consume>BPEL1 (One way) invoke>Mediator service (one way) route> BPLE2 (one way). Also I have added transaction properties in BPEL1 and 2 + References + Services.
    Now, if there is a fault in BPEL2 the transaction should be rolled back in BPEL1 and the message should be seen in the WL queue itself. But that is not happening in my case. Everything is getting rolled back upto a point just after the >recieve activity in BPEL1 except the message is not getting rolled back to queue.There will be 2 transactions in this scenario : 1) jms queue to soa hydration store 2) soa-hydration to bpel execution.
    This is the behaviour for 1 way or async interfaces , jms adapter thread completes its transaction work after persisitng to dehydration store and another bpel system thread starts work executing the bpel code after retrieving the message off the db in a separate transaction. So the rollback you are seeing is only applicable for 2nd transaction which roll backs to the dehydration store instead of the queue.
    For synchronous interfaces, the same adapter thread will be involved for complete message processing including bpel code execution. So I think if you want to get the jms queue within the same transaction you can try set up the interfaces to be sync, even with dummy responses. This might make jms adapter thread to start a transaction --> read message off queue within the same transaction --> execute bpel code within same transaction --> complete/rollback transaction based on bpel code execution.

  • Web services and message ordering

    i am a newbie to Rest services and camel. please help me. message(xml)will be sent from services at endpoint 1 to services exposed @ endpoint 2. i am not going to use queue or anything in between. but i want message ordering for few instances. so how is it possible. is there any option available. thanks

    thanks for the response.
    I dont wait for response 1 before sending request 2 and thats why am asking qn on how to preserve order. communication is not synchronous. i send multiple messages to different threads and i will not know the order across the whole message stream as each thread will process messages concurrently.
    For example i will be sending message 1 and message 2 which should go in order. For some reason if message 2 goes before message 1 my whole requirement will fail. if i use queue in between i can preserve the order but am not going to use queue. so is there anything i can do to ensure that message 1 goes before message 2?

  • JMS Message ordering

    What does the JMS specification (in J2EE version 1.3) say about queues having to support message ordering for messages of the same priority?
    Is this a requirement or not....?
    Thanks for your help.
    Brent Miller
    Chicago, IL

    Hi,
    About the order of message receipt, JMS1.1 specs say that Messages consumed by a session define a serial order. JMS defines that messages sent by a session to a destination must be received in the order in which they were sent. However, JMS does not define order of message receipt across destinations or across a destination's messages sent from multiple sessions.
    However, an important point to note here is that several things can affect this order:
    1) Messages of higher priority may be received before previous lower priority messages sent.
    2) A client may not receive a NON_PERSISTENT messages due to a JMS provider failure.
    3) If both PERSISTENT and NON_PERSISTENT messages are sent to a destination, order is only guaranteed within delivery mode i.e. a later NON_PERSISTENT message may be received before an earlier PERSISTENT message. However, it will definitely arrive ahead of an earlier NON_PERSISTENT message with the same priority.
    Manish

  • How to set up the maximum number of messages on a queue programmatically

    Hi,
    I am using IMQ 3.5 to implement a message layer for one of my projects. I created a "Job Status Queue", which receives job status report from a java application every minute. But I just want to keep the most current status report instead of all the job running history. How can I restrict the maximum number of messages to 1 programmatically?
    Any suggestion or help will be appreciated.
    Xiaoyun Tang

    You can't limit the destination size programmatically, but you can do it administratively and associate a behavior to occur when the limit is reached. In your case it sounds like you want a queue, 1 message deep, and to discard the oldest message when the queue is full. When you create the physical queue on the broker you can specify these attributes (you can also update them on an existing queue). For example:
    imqcmd create dst -t q -n StatusQ -o maxNumMsgs=1 -o limitBehavior=REMOVE_OLDESTFor more information see Chapter 6 of the Message Queue Administration Guide. In particular the "Managing Destinations" section:
    http://docs.sun.com/app/docs/coll/MessageQueue_35_SP1
    Joe

  • How do i find the number of messages in a queue

    Sorry if this is too trivial, but i haven't been able to figure out how to determine the number of messages in a queue. business case being that i can only have 3 messages in the send queue, so i need to stop sending if there are 3 outstanding messages still in the send queue.
    Can someone point the way?
    Thanks,
    Nilesh

    Hi,
    To get the depth using JMS you must create a QueueBrowse and browse the entire queue. Its generally horribly inefficient if you want to do it with any regularity.
    In Hermes I have had to write plugins that open separate connections to providers using their non-JMS APIs or JMX and get that kind of information that way.
    Look at the getDepth() method in this JBoss plugin for an example that uses JMX:
    http://cvs.sourceforge.net/viewcvs.py/hermesjms/Hermes4/src/java/hermes/ext/jbossmq/JBossMQAdmin.java?view=markup
    And here is one for WebSphereMQ that uses one of its many APIs..
    http://cvs.sourceforge.net/viewcvs.py/hermesjms/Hermes4/src/java/hermes/ext/mq/MQSeriesAdmin.java?view=markup
    Colin.
    http://hermesjms.com

  • Error while trying to pick message from weblogic queue

    Hi,
    We are getting the following error while trying to connect to pick up a message from weblogic queue.
    We are suing oracle soa suite 10.1.3.1 and weblogic 8.1
    the bad part is that, this error is not documented anywhere and couldn't get much help on this.
    Would appreciate any suggestions / pointers on this.
    Let me know if any further information is required.
    invoke failed
    org.collaxa.thirdparty.apache.wsif.WSIFException: file:/E:/product/10.1.3.1/OracleAS_4/bpel/domains/default/tmp/.bpel_OTOCBPELProcess_1.0_78fcf080ec2bd7495aebfb5373e76116.tmp/readmsg.wsdl [ Consume_Message_ptt::Consume_Message(opaque) ] - WSIF JCA Execute of operation 'Consume_Message' failed due to: ERRJMS_IX_WRONG_SPEC.
    Outbound interaction invoked with incorrect InteractionSpec.
    ; nested exception is:
    ORABPEL-12115
    ERRJMS_IX_WRONG_SPEC.
    Outbound interaction invoked with incorrect InteractionSpec.
    ---------------------------------------------------

    Hi!
    I am facing a similar issue, does someone have an idea ?
    <remoteFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>null</code>
    </part><part name="detail"><detail>null</detail>
    </part><part name="summary"><summary>file:/opt/oracle/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_TestReceiveMessage_BPEL_1.0_e00fd88d454889b871183d0d92dc9f7d.tmp/plReceiveMessage.wsdl [ Consume_Message_ptt::Consume_Message(TestPushMessage_BPELProcessRequest) ] - WSIF JCA Execute of operation 'Consume_Message' failed due to: ERRJMS_IX_WRONG_SPEC.
    Outbound interaction invoked with incorrect InteractionSpec.
    ; nested exception is:
         ORABPEL-12115
    ERRJMS_IX_WRONG_SPEC.
    Outbound interaction invoked with incorrect InteractionSpec.
    Please examine the log file to determine the problem.
    </summary>
    </part></remoteFault>
    Thanks,
    romain.

  • Error while sending the messages to JMS Queue

    Hi ,
    I am trying to pick the file from JMS Queue and send the response xml as outbound message to JMS Queue again using XAI Sender
    I Created XAI Sender, Outbound Message Type(DM-RCVRESP) and configured these two with External System.
    I am able to pick the file from JMS Queue but unable to send the message through XAI Sender (Real-time)
    Plz find below the error trace getting.
    [Wed Jun 15 16:12:09 IST 2011] Error while processing sender "UPLOADSTG" : Unable to update response in staging table: Row id not given.
    com.splwg.mpl.sending.SameThreadSendingManager$ProcessException
         at com.splwg.mpl.sending.SameThreadSendingManager.processDestination(SameThreadSendingManager.java:341)
         at com.splwg.mpl.sending.SameThreadSendingManager.sendResponse(SameThreadSendingManager.java:293)
         at com.splwg.mpl.sending.SameThreadSendingManager.doSend(SameThreadSendingManager.java:249)
         at com.splwg.mpl.server.async.ExecSendRequestProcessor.ProcessRequest(ExecSendRequestProcessor.java:61)
         at com.splwg.mpl.server.async.RequestProcessingThreadAdapter.run(RequestProcessingThreadAdapter.java:46)
         at com.splwg.mpl.server.PooledThread.run(PooledThread.java:91)
         at java.lang.Thread.run(Thread.java:662)
    Please guide me in this regard..
    Thanks,
    sukumar

    What have you configured for the response tab for the sender? Are you using the MPL or the MDB?
    Take a look at:
    MPL Best Practices (Doc Id 1308165.1)
    Oracle WebLogic JMS Integration (Doc Id: 1308181.1)

  • TS3147 Since my last update for Mac OS X Lion 10.7.5 I have been unable to print to either my HP or Lexmark printers!  Everything is connected but I get an "idle" message in the queue.  I have "Reset printer system" and re-added these printers. No luck. H

    Since my last update for Mac OS X Lion 10.7.5 I have been unable to print to either my HP or Lexmark printers!  Everything is connected but I get an "idle" message in the queue.  I have "Reset printer system" and re-added these printers. No luck. Help?

    Hello,
    It isn't the fw in Network you want o use or look at, that's for something completely different.
    My first suspect is the Power Adapter on the LaCie has gone.
    At the Apple Icon at top left>About this Mac, then click on More Info, then click on Hardware>Firewire, what is listed there?
    Reset the Firewire bus
    If your Firewire or USB isn't recognizing any device.  A solution which has worked for some whose hard drive became invisible in 10.4 was simply to follow these four steps to reset the Firewire/USB bus:
    1. Shut the machine down.
    2. UNPLUG the power lead to the computer and any firewire/USB drive or devices.
    3. leave it for 10 minutes.
    4. Connect back up and reboot.
    http://www.macmaps.com/firewirebug2.html

Maybe you are looking for