JMS Transactions

Does WLS 6.1/7.0 support JMS>JTA distributed transactions?
          http://e-docs.bea.com/wls/docs61/jms/intro.html#1048981
          http://e-docs.bea.com/wls/docs70/jms/intro.html#1048981
          Regards,
          Pieter Van Gorp.
          

Attached...you should have the examples directory if you have installed
          samples...one of the installation option I believe...
          .raja
          "Bob Lee" <[email protected]> wrote in message
          news:[email protected]...
          > I have WebLogic Server 6.1, but I don't seem to have that example. I don't
          > have a "jms" directory at all. Can you post the relevant snippet?
          >
          > Thanks,
          > Bob
          >
          >
          > "Raja Mukherjee" <[email protected]> wrote in message
          > news:[email protected]...
          > > Yes. Take a look in the
          > > $WL_HOME/samples/examples/jms/queue/QueueReceiveInTx.java for an example
          > for
          > > receive part. Basically the same for send.
          > >
          > > .raja
          > >
          > > "Bob Lee" <[email protected]> wrote in message
          > > news:[email protected]...
          > > > Can I use the JTS with JMS from a remote client (i.e. outside of the
          > > > application server)?
          > > >
          > > > I have a standalone client that is sending a message to the JMS server
          > in
          > > > WebLogic. I want the message to be sent in a transaction. Is this how
          it
          > > > goes?:
          > > >
          > > > Get UserTransaction via JNDI
          > > > Start Tx
          > > > Send Message
          > > > Commit Tx
          > > >
          > > > Thanks,
          > > > Bob
          > > >
          > > > "Raja Mukherjee" <[email protected]> wrote in message
          > > > news:[email protected]...
          > > > > Yes
          > > > >
          > > > > .raja
          > > > >
          > > > > "Pieter Van Gorp" <[email protected]> wrote in message
          > > > > news:[email protected]...
          > > > > > Does WLS 6.1/7.0 support JMS>JTA distributed transactions?
          > > > > >
          > > > > > http://e-docs.bea.com/wls/docs61/jms/intro.html#1048981
          > > > > > http://e-docs.bea.com/wls/docs70/jms/intro.html#1048981
          > > > > >
          > > > > > Regards,
          > > > > > Pieter Van Gorp.
          > > > > >
          > > > > >
          > > > >
          > > > >
          > > >
          > > >
          > >
          > >
          >
          >
          [QueueReceiveInTx.java]
          

Similar Messages

  • Can we handle various other kind of transactions in JMS transaction?

    I know we can handle heterogenous transactions like JDBC Transactions, JMS transactions, etc from JTA.
    Can we similarly handle such various txns in JMS transactions also?
    SO say when I get a message, I need to send another message, and update some 2-3 DB instances. If any of latter 2 fails whole JMS txn should rollback.
    Is it possible in JMS?
    Please point me some online docs if available.
    Thanks in advance

    Yes it is. Use 2 Phase commit,(these are this X... Classes)
    Edited by: lieni on Jan 9, 2008 10:42 PM

  • Recovering Inactive JMS Transactions

    I'm running WL server 10.3.3 with "plain old" JMS transactions (no JTA), run from a WL JMS 'C' interface based client.
    Occasionally I see the following JMS error returned in place of a transaction timeout. I.e. this happens at the time a transaction should have timed out:
    'Attempt to resume an inactive transaction: BEA1-075EEE16749AF9834384:error resuming transacted session's internal transaction'
    Once this happens, the transaction appears to be "frozen". It cannot be committed or rolled back, since it keeps generating that same inactive transaction error. The messages associated with that transaction are "stuck" inside the application until they're committed using another session / transaction. So far, the messages read with the transaction that turns inactive don't reappear on the queue until the application exits; this means that the messages would reappear on the queue after exit, and presumably be processed a second time once the application starts again.
    Is there any way to recover/commit/rollback an inactive transaction without quitting the application that started it?
    Thanks for your help.

    I haven't tried that. However, that's a manual operation, which isn't practical to do on a customer site. I'm looking for a way to recover inactive transactions programatically.
    BTW, I found out that most of these inactive transactions are caused by the JTA transaction timeout value being set lower than the Connection Factory transaction timeout value. While that doesn't solve the problem completely, it does allow us to remove the most common source of inactive transactions by co-ordinating the timeout values.

  • JMS (Transaction ???) problem, consumer receives all messages at once.

    Hallo, I have an application which implements asynch communication between the web and business layer using JMS.
    On a page a user can upload files, which are processed by the backend. For large files this can be a long running process, thats why we use JMS to send the file asynchronously and use JMS to update progress information on the page.
    The application works fine on JBoss 6 with HornetMQ.
    After porting to Weblogic I see consistently a strange phenomenon. The update messages from the processing backend logic are send as expected. But the receiver does not receive one message after another but receives all the messsages almost at once after only the producer has sent the last message.
    For me this is totally unexpected behavior and of course our progress bar on the page does not work properly, but merely jumps from 0 to 100% after the data has been processed.
    It looks like the consumer waits until the producer has finished its transaction. But how can this be possibly? I have learned that transaction never span producer - messagesystem - consumer.
    Example Code:
    Producer:
    import javax.annotation.PostConstruct;
    import javax.annotation.PreDestroy;
    import javax.annotation.Resource;
    import javax.ejb.EJB;
    import javax.ejb.Stateless;
    import javax.interceptor.Interceptors;
    import javax.jms.Connection;
    import javax.jms.ConnectionFactory;
    import javax.jms.DeliveryMode;
    import javax.jms.Destination;
    import javax.jms.JMSException;
    import javax.jms.MessageProducer;
    import javax.jms.Session;
    import javax.jms.TextMessage;
    import org.apache.log4j.Logger;
    import com.sun.tools.ws.wsdl.document.jaxws.Exception;
    import dsde.core.aspects.DsdeException;
    import dsde.core.aspects.ExceptionHandler;
    import dsde.core.entity.Data;
    @Stateless
    @Interceptors(ExceptionHandler.class)
    public class ParserBean implements Parser {
         private Logger log = Logger.getLogger(this.getClass());
         @EJB
         private DataDAO dataDAO;
         //Weblogic
         @Resource(mappedName="jms.BackQueue")
         //Jboss
         //@Resource(mappedName="queue/dsdeBackQueue")
         private Destination backQueue;
         //Weblogic
         @Resource(mappedName="jms.dsdeConnectionFactory")
         //JBoss
         //@Resource(mappedName="XAConnectionFactory")
         private ConnectionFactory connectionFactory;
         private Connection connection;
         @Override
         public void parse(String text, String description, String sessionId) throws DsdeException{
              double percentDone = 0;
              double j = 0.0;
              //Simuliere was langdauerndes, schwieriges
              for (int i=0; i < text.length(); i++) {
                   j = i;
                   percentDone = j / text.length() * 100;
                   try {
                        Thread.sleep(1000);
                   } catch (InterruptedException e) {
                        log.error(e);
                   if (i % 2 == 0) {
                        //periodisch das Frontend mit dem Fortschritt updaten
                        sendFeedback((int)percentDone, sessionId);
              //Zum Schluss noch senden dass wir fertig sind
              //Sonst wird der Send Button nicht wieder aktiv
              percentDone=100;
              sendFeedback((int)percentDone, sessionId);
              //Jetzt wird noch richtig geparsed :-)
              String[] words = text.split(" ");
              //Entity konstruieren
              Data data = new Data(description, words);
              //Das Ergebnis in die Datenbank schreiben
              dataDAO.saveData(data);
         private void sendFeedback(int percentDone, String sessionId) {
              Session session = null;
              try {
                   session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                   MessageProducer producer = session.createProducer(backQueue);
                   producer.setTimeToLive(50000);
                   producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
                   TextMessage message = session.createTextMessage();
                   message.setJMSCorrelationID(sessionId);
                   message.setText("" + percentDone);
                   producer.send(message);
                   log.info("ParserBean has sent " + percentDone);
              } catch (JMSException e) {
                   log.error(e);
              } finally {
                   if (session != null) {
                        try {
                             session.close();
                        } catch (JMSException e) {
                             log.error(e);
         @PostConstruct
         public void init(){
              try {
                   connection = connectionFactory.createConnection();
              } catch (JMSException e) {
                   log.error(e);
         @PreDestroy
         public void close() {
              try {
                   connection.close();
              } catch (JMSException e) {
                   log.error(e);
    }Consumer:
    import javax.annotation.ManagedBean;
    import javax.annotation.PostConstruct;
    import javax.annotation.PreDestroy;
    import javax.faces.bean.SessionScoped;
    import javax.faces.context.FacesContext;
    import javax.jms.Connection;
    import javax.jms.ConnectionFactory;
    import javax.jms.JMSException;
    import javax.jms.Message;
    import javax.jms.MessageConsumer;
    import javax.jms.MessageListener;
    import javax.jms.Queue;
    import javax.jms.Session;
    import javax.jms.TextMessage;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.servlet.http.HttpSession;
    import org.apache.log4j.Logger;
    @ManagedBean
    @SessionScoped
    public class FeedbackReceiverBean implements MessageListener {
         private Logger log = Logger.getLogger(this.getClass());
         //jndi names of managed objects
         private String connectionFactoryName;
         private String queueName;
         private Connection connection;
         private Session session;
         private int percent;
         private boolean disabled;
         public boolean isDisabled() {
              return disabled;
         public void setDisabled(boolean disabled) {
              this.disabled = disabled;
         public int getPercent() {
              return percent;
         public void setPercent(int percent) {
              this.percent = percent;
         public void setConnectionFactoryName(String connectionFactoryName) {
              this.connectionFactoryName = connectionFactoryName;
         public void setQueueName(String queueName) {
              this.queueName = queueName;
         @PostConstruct
         public void init() throws NamingException, JMSException {
              FacesContext facesContext = FacesContext.getCurrentInstance();
              HttpSession httpSession = (HttpSession) facesContext.getExternalContext().getSession(false);
              String sessionId = httpSession.getId();
              Context context = new InitialContext();
              ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup(this.connectionFactoryName);
              Queue queue = (Queue) context.lookup(this.queueName);
              this.connection = connectionFactory.createConnection();
              this.session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
              String filter = "JMSCorrelationID = '" + sessionId + "'";
              MessageConsumer consumer = session.createConsumer(queue, filter);
              consumer.setMessageListener(this);
              connection.start();
         @PreDestroy
         public void close() throws JMSException {
              this.session.close();
              this.connection.close();
         @Override
         public void onMessage(Message message) {
              if (message instanceof TextMessage) {
                   TextMessage textMessage = (TextMessage) message;
                   try {
                        this.percent = Integer.parseInt(textMessage.getText());
                        if (percent >= 100) {
                             this.disabled = false;
                        log.info("Prozent " + percent);
                   } catch (JMSException e) {
                        log.error(e);
              else {
                   log.error(message.toString() + " is no TextMessage");
         public void disable() {
              this.disabled = true;
    }Configuration:
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-jms xmlns="http://xmlns.oracle.com/weblogic/weblogic-jms" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-jms http://xmlns.oracle.com/weblogic/weblogic-jms/1.1/weblogic-jms.xsd">
      <connection-factory name="dsdeConnectionFcatory">
        <default-targeting-enabled>true</default-targeting-enabled>
        <jndi-name>jms/dsdeConnectionFactory</jndi-name>
        <default-delivery-params>
          <default-delivery-mode>Persistent</default-delivery-mode>
          <default-time-to-deliver>0</default-time-to-deliver>
          <default-time-to-live>100</default-time-to-live>
          <default-priority>4</default-priority>
          <default-redelivery-delay>0</default-redelivery-delay>
          <send-timeout>10</send-timeout>
          <default-compression-threshold>2147483647</default-compression-threshold>
        </default-delivery-params>
        <client-params>
          <client-id-policy>Restricted</client-id-policy>
          <subscription-sharing-policy>Exclusive</subscription-sharing-policy>
          <messages-maximum>10</messages-maximum>
        </client-params>
        <transaction-params>
          <xa-connection-factory-enabled>true</xa-connection-factory-enabled>
        </transaction-params>
        <security-params>
          <attach-jmsx-user-id>false</attach-jmsx-user-id>
        </security-params>
      </connection-factory>
      <queue name="dsdeQueue">
        <sub-deployment-name>dsdeQueue</sub-deployment-name>
        <jndi-name>jms/dsdeQueue</jndi-name>
      </queue>
      <queue name="dsdeFeedbackQueue">
        <sub-deployment-name>dsdeFeedbackQueue</sub-deployment-name>
        <jndi-name>jms/dsdeFeedbackQueue</jndi-name>
      </queue>
      <queue name="dsdeBackQueue">
        <sub-deployment-name>dsdeBackQueue</sub-deployment-name>
        <jndi-name>jms/BackQueue</jndi-name>
      </queue>
    </weblogic-jms>Any help would be greatly appreciated.
    Thanks,
    Hans

    Thanks for posting your analysis!
    I think your solution is probably best.
    FYI: Your JMS session was never a "transacted" session. It's definitely confusing, but the term "transacted session" has a special meaning in JMS, it actually refers to a session that is not XA/JTA aware and instead maintains an internal local transaction that's scoped only to the current JMS session's operations. A transacted session is created by passing "true" to the first parameter of createSession, and such a session's local transaction is committed by calling session.commit() (which starts a new transaction). To further add to the confusion, I think that JEE servers are actually obligated to ignore requests to set the transacted flag to true -- WebLogic does this trick by secretly wrapping access to the JMS API when applications lookup JMS connection factories via a resource reference.
    Regards,
    Tom

  • Distributed JDBC/JMS transaction commit order

    I am using WLS 10.3.0. I have an app with container-managed EJBs which participate in distributed transactions using XA drivers for two resources, (1) a jdbc connection to Oracle database, and (2) WebLogic JMS server. In a typical EJB call, I am writing a record to the database and sending a message to a local queue which is being consumed by a MDB. My question is how can I guarantee that by the time the MDB receives the JMS message, the record will be guaranteed to have been committed in the database. It appears that occasionally the record is not yet there. Is there a way to force the jdbc commit to happen before the JMS message gets consumed? I know there is a commit_point_strength parameter that determines commit order for the database resource, but I don't see such a concept for JMS...

    "The Default Time-to-Deliver attribute for XAConnectionFactory for the Weblogic JMS connection queue, is a minimum interval from when the message is SENT, to when it is available to be processed. What is really needed is a delay from COMMIT time -- not from the sent time."
    <jay>
    Not entirely true. Delay is not from when message is “SENT, Default Time-To-Deliver is delay at within JMS subsystem before it delivers message to consumer. It means that "Send" thread will not block for this delay and "Send" side executes no different whether there is "Time-to-Deliver" configured or not.
    </jay>
    "For example, imagine a distributed transaction does a JMS send, followed by a query that takes 10 seconds, followed by a commit. If Default Time-to-Deliver is set to 5 seconds, it will be completly ignored, since the 10 seconds from the send to the commit is a larger interval. So at commit it is still very possible that the MDB will receive the message before the database transaction is committed."
    <jay>
    This is not true also. JMS message will be available for delivery only after distributed transaction commits and more specifically "commit" part of the JMS resource completes - clock for "message delivery delay" will not start until distributed transaction is committed. Considering transaction will not commit until slow running query completes execution above scenario will not cause “Default Time-to-Deliver” workaround to fail.
    Slow execution of the XA.commit() request from TM (Weblogic) to database may cause concern , however considering that TM (WebLogic) receive response of the XA.prepare() from all participating resources before XA.commit(), commit should execute with delay not more than few milliseconds and chances are negligible that proposed workaround will fail.
    </jay>
    "The bottom line, is that this parameter is not an effective way to control the race condition unless the JMS send is always performed as the last action in a distributed transaction.
    For this reason we have gone with inserting a small configurable sleep at the start of the onMessage() methods in the MDB. Not a very elegant solution, but the one ne that works reliably."
    <jay>
    I think "Default Time-to-Deliver" is no less effective or no less reliable solution than placing sleep() in onMessage(), however it is more cleaner solution because it uses application server built in feature instead of updating code in onMessage().
    </jay>
    -jayesh@yagna

  • JMS transaction rollback from Javacallout

    Hi,
    I have a proxy which insert message into queue via business service, and i have another proxy which pull message from queue and call to javacallout which returns boolean (true/false). During some processing javacallout return a boolean false. I have managed for checking if the boolean returned in false then i want to rollback the transaction and message to put back to queue.
    I have setting "Is XA required = true" and JMS proxy configured for XA connection.
    When i recieve boolean false from javacallout i am raising error which is not handled by any error handler. I dont have stage error handler, no service error handler and hence according to me error should propegate and it should rollback.
    But message is not rollback to queue.
    I have "Redelivery Delay Override", "Redlivery Limit" property set to -1 (default) and "Expiration Policy" set to "Discard" and no "Error Destination" selected for Queue setup.
    I am using Oracle Service Bus 10gR3 version.
    I am new to this type of configuration and i suppose i am missing some configuration here.
    Please help me, its little urgent.
    Thanks
    Sujit

    Hi Sujit,
    I have "Redelivery Delay Override", "Redlivery Limit" property set to -1 (default) and "Expiration Policy" set to "Discard" and no "Error Destination" selected for Queue setup.
    Change the Redelivery Limit field  to 3 ( specify the number of redelivery tries a message can have before it is moved to an error destination  like three times)
    Select Redirect as Expiration Policy.
    Select ErrorQueue ( Queue where you wants the rollback message should enqueue) as the Error Destination value.
    make sure to use XA connection factory.
    Hope it helps ..
    Regards,
    Abhinav Gupta

  • JMS Transaction problem

    Hi
    I am using JBoss 3.2.3 and I have a MDB which calls up some entity beans Home and Business methods.
    onMessage use both JMS and JDBC transactions and I have configured my Oracle-XA-Ds to handle transactions.
    10:22:32,415 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl [Fo
    rmatId=257, GlobalId=sanjeewad//33, BranchQual=] errorCode=XAER_RMERR
    oracle.jdbc.xa.OracleXAException
    at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1157
    at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:29
    5)

    Are you using Container Managed Transactions or Bean Manager Transactions? If CMT, what is the type set to 'Required'? You need Required in a CMT MDB to enable an XA transaction to be created /joined/rolled back.
    Scott
    http://www.swiftradius.com

  • OSB JMS transaction

    I'm trying to setup a proxy service to dequeue a message from JMS and submit to a business service. If the business service fails, I want the jsm message to remain in the queue/"rollback". I setup a queue CF with "XA Connection Factory Enabled", and I have a proxy service dequeueing from a queue through that connection factory. In the proxy service I have the "Is XA Reuired" box checked on the "JMS Transport" tab, and in the message flow, I have a route node with an exception handler that is calling the business service that I have setup to fail on purpose. The exception handler has a Reply "with failure" action.
    OSB-PS -> JMS -> OSB-PS -> OSB-BS -> Failing Service
    I want this to roll back to the JMS queue.
    Did I miss anything in setting up the XA support for this process? When I invoke the proxy service, it errors off, but the message doesn't get rolled back to the original queue.
    Does anyone have an example or docs on how to set this up?
    Thanks for any help.

    Hi All,
    I have checked the Retry with Application Errors, but no change.
    Also have a Routing Option set to "Exaclty Once".
    There is also a Route error handler where I raise an error and Reply with Failure.
    The JMS Connection Factory used is XA enabled and so is the JMS Proxy service.
    The strange thing I observe is when the endpoint server is down, teh transaction gets rolled back and remains in the queue.
    However, when the server is up but the path of the URI given is either incorrect(404 HTTP Response) or there is an internal server error(500 HTTP response),
    the message is picked up from the queue and is lost.
    What I am supposing the reason would be, the proxy is able to make connection to the http uri but there is an error from the business service, while in the first case, the server is not up and hence the connection itself is failing and the transaction is getting rolled back at the request pipeline level itself.
    I compared the logs when server is down and when the path is not found-> the difference I found was
    1. Server is down: Fault occurs in the flow of the Request flow of the Route node
    2. Server is up but path not found or internal error: Fault is thrown in the response action after getting the HTTP response.
    I have even tried Raise Error and Reply with failure at the Service Error Handler level as well, but the message is lost :(
    Could anyone please help me out on this? Is there any workaround for the same?

  • JMS transaction between two queues

    Hi there,
              I have been asked to build some code that will act as an adapter
              between two legacy systems. Basically I will have to read from a
              queue, transform the information and write it to the other, then
              receive the response, transform it, and put it again back to the
              "caller" system.
              There are 4 queues implicated in this task.
              I will to use JMS Api in my code but I have found a problem. The way
              of performing a transaction in JMS is this:
              QueueSession queueSession = queueConnection.createQueueSession(true,
              0);
              "Here, the first argument means that the session is transacted; the
              second indicates that message acknowledgment is not specified for
              transacted sessions."
              As queueConnection is a connection to ONE queue, I can only perform
              transactions to ONE queue! But I don´t want to consume a message till
              I know it has been sent correctly to the other side.
              I have also read that some JMS providers support JTA transactions.
              But I don´t know if this is the right way to go.
              Can anybody bring some light to this issue.
              Thaks al lot for your attention!!
              

              This post has blossomed into several threads. I'm going to
              attempt a shot-gun approach to answer all questions.
              On MQSeries:
              See "How to use IBM MQ as a JMS Provider?" posts for more info.
              On transacted sessions:
              If this is ALL MQSeries, then it is up to MQSeries if a transacted
              session can span multiple queues and/or servers. WL supports this.
              MQSeries may simply prevent a session from
              spanning multiple servers and/or queues. Note that other vendors,
              that do not have their own TX monitor, very very likely do
              not have a 2PC in a transacted session that spans multiple servers
              (meaning it is not truly transactional).
              On JTA and multiple queues:
              The whole reason for being for JTA is to be able to span multiple
              operations. Yes, this is supported in WL.
              On the manuals:
              These issues are covered in great detail in the WL JMS developer's
              guide in the transactions chapter.
              On bridging:
              You do not have to write your own bridge.
              WL supplies a bridge to greatly simplify the work involved.
              WL 7.0 can even bridge two XA compliant JMS implementations transactionally.
              (Neither has to be WL JMS.) WL 6.1SP3 will have this same feature, now
              avialable as alpha code in 6.1. See "How to use IBM MQ as a JMS Provider?" posts for more
              info.
              On queuing and transactions:
              One can not include a request and its response in the same transaction. Period.
              This is the nature of queueing. One can dequeue from one queue and
              enqueue to another. I think you understand this, but it bears repeating.
              Tom
              Mac wrote:
              > I know that a recieve will not remove a message and a send will not
              > send it until the transaction is commited.
              >
              > In fact I want to do 2 transactions one for each receive-send.
              >
              > graphic again! ;)
              >
              > queue1 queue3
              > ======> =====>
              > legacy 1 Java Adapter legacy 2
              > queue2 queue4
              > <====== <=====
              >
              > In the period of time between reading from queue1 and writing to
              > queue3 the adapter could fail thus a message will be lost. The same
              > happens with queue4 and 2. Maybe this could be solved with a
              > transaction over queue1 and another one over queue4, but I'm not sure.
              >
              > I will have to decide if I use JMS or MQSeries API. MQ allows you to
              > wrap more than one queue in the same transaction if they are in the
              > same Queue Manager. So I wanted to know if JMS also allows to make a
              > transation over more than one queue and how is it done. only JTA?
              > QueueSession? impossible?
              >
              > tnx really for your help!
              >
              > "Raja Mukherjee" <[email protected]> wrote in message news:<[email protected]>...
              > > You can not. Even if you could, it's at least have to be 2 transactions.
              > > Because, if all of your work is in one transaction you will never send or
              > > receive messages, you would be blocking for ever. In order to send the
              > > message you will have to commit the transaction on the first place.
              > >
              > > .raja
              > >
              > > "Mac" <[email protected]> wrote in message
              > > news:[email protected]...
              > > > Sorry Tom, I think that I have not explained well my problem.
              > > >
              > > > The following extrange symbols are supposed to be an explaining
              > > > graphic!! ;)
              > > >
              > > >
              > > > queue1 queue3
              > > > ======> =====>
              > > > legacy 1 Java Adapter legacy 2
              > > > queue2 queue4
              > > > <====== <=====
              > > >
              > > > Legacy System 1 wants to call a service of legacy system 2, but they
              > > > can not communicate directly so we will use MQ Series as both them
              > > > support it.
              > > > For that purpose Legacy1 puts a message in queue1. The Java Adapter
              > > > transforms the message and puts it in queue3. Legacy2 processes the
              > > > request and replies with a message in queue4. The Java Adapter gets
              > > > it, transforms it and puts it in queue2. As a result legacy1 obtains
              > > > the information it was asking for.
              > > >
              > > > I'm using MQ Series 5.2 as middleware. I will not use Message Driven
              > > > Beans so I won´t have an EJB container to perform distributed
              > > > transactions.
              > > >
              > > > The question is: How can I put and get messages in the 4 queues
              > > > using de same transaction?? Can I do it somehow with JMS session or I
              > > > must use a JTA transaction?
              > > >
              > > > Thanks again for your help, and forgive me for being so insistent!
              > > > :)
              [att1.html]
              

  • JMS Transaction Questions

              Greetings,
              I have the following questions regarding Transactions in JMS:
              1. What constitutes a transaction in JMS? Assuming there are 2 clients, one which
              is just a Subscriber and the other just a Publisher. What will constitute a transaction
              in this scenario?
              2. While configuring, JMS Connection Factory, a parameter present is " Transaction
              Timeout ", with a defualt value of 3600 secs. At what point, does this time starts
              ticking ? Is there anyway to disable this value or the only solution is to increase
              it as required.
              

              vinay s wrote:
              > Greetings,
              >
              > I have the following questions regarding Transactions in JMS:
              > 1. What constitutes a transaction in JMS? Assuming there are 2 clients, one which
              > is just a Subscriber and the other just a Publisher. What will constitute a transaction
              > in this scenario?
              >
              A receive or send operation performed under a transaction. The operation
              becomes transactional.
              >
              > 2. While configuring, JMS Connection Factory, a parameter present is " Transaction
              > Timeout ", with a defualt value of 3600 secs. At what point, does this time starts
              > ticking ? Is there anyway to disable this value or the only solution is to increase
              > it as required.
              This applies to transacted sessions. A special kind of transactional behavior
              unique to JMS. WL JMS also supports user transactions (JTA), which
              is more unique.
              Note that 3600 seconds is a long time, standard transactions actually
              default to a limit of 30 seconds...
              To learn about this stuff, I recommend reading the WebLogic JMS Programmer's guide - there
              is a chapter on
              transactions. Check out the performance white-paper I posted to this newsgroup last
              Thursday - there is
              a section in there on transacted sessions vs. user transactions...
              

  • JMS Transaction and differnt behavior of Autocommit (Java, WebLogic)

    Hi all,
    Behavior of Autocommit for JMS Tranasactions is different. JMS Modules are in webLogic Server and in Backend is Oracle DB (RAC) available.
    A- autocommit is active (e.g. from Java code)
    private static final String QUEUE_CONNECTION_FACTORY_JNDI_NAME = "java:comp/env/jms/defaultQueueConnectionFactory";
    private static final String QUEUE_JNDI_NAME = "java:comp/env/jms/defaultQueue";
    final QueueConnectionFactory connectionFactory = (QueueConnectionFactory) jndiContext.lookup(QUEUE_CONNECTION_FACTORY_JNDI_NAME);
    final Queue destination = (Queue) jndiContext.lookup(QUEUE_JNDI_NAME);
    B- autocommit is NOT active (e.g. from Java code)
    private static final String QUEUE_CONNECTION_FACTORY_JNDI_NAME = "jms/QueueConnectionFactories/MYQUEUECF";
    private static final String QUEUE_JNDI_NAME = "jms/Queues/MYQUEUE";
    (That means "java:comp/env" is not defined...)
    C- Now, autocommit is active again (e.g. from Java code)
    @Resource(name = JNDINames.MYQUEUE_CONNECTIONFACTORY_NAME, mappedName = JNDINames.MYQUEUE_CONNECTIONFACTORY_JNDI_NAME)
    private QueueConnectionFactory connectionFactory;
    @Resource(name = JNDINames.MYQUEUE_NAME, mappedName = JNDINames.MYQUEUE_NAME)
    private Queue destination;
    public static final String MYQUEUE_CONNECTIONFACTORY_JNDI_NAME = "jms/QueueConnectionFactories/MYQUEUECF";
    public static final String MYQUEUE_CONNECTIONFACTORY_NAME = "jms/defaultQueueConnectionFactory";
    public static final String MYQUEUE_JNDI_NAME = "jms/Queues/MYQUEUE";
    public static final String MYQUEUE_NAME = "jms/defaultQueue";
    Can some body explain me, why the statements have different behavior?
    Regards,
    Moh

    @Resource(name = JNDINames.MYQUEUE_NAME, mappedName = JNDINames.MYQUEUE_NAME)did you intend the mappedName there to be MYQUEUE_JNDI_NAME?

  • JMS and transactions

    Dear all,
    I need some clarification about JMS for my Thesis : after reading some tutorials I still am confused about JMS used with JTA transactions.
    1) If a JMS transacted session is started within a JTA transaction (let's say a UserTransaction spanned by an EJB) and the transaction rolls back, the message will be put back in the Queue, right ?
    2) Is it true also the opposite ? that is if I perform some insert/delete/update within a JMS transacted session, and the transaction is rolled back, the insert/delete/update are rolled back too ?
    Thank you very much for your help
    Lucas

    Hi Lucas,
    What you describe requires XA or distributed transactions. And (I'm fairly sure) XA doesn't work with Bean Managed Transactions and the UserTransaction interface. XA allows multiple transactional resources to get enlisted in a global transaction. When the app server decides all the work is done, the global transaction is committed or rolled back using a two-phase commit protocol.
    So except for the UserTransaction bit, what you describe is how it works. The messages will be only sent/received and the database work will only be committed if the whole global transaction is committed. If any part is rolled back, everything will be rolled back. JMS implementations typically will set the JMSRedelivered flag along with incrementing the JMSXDeliveryCount property when messages are put back on the destination.
    Dwayne
    =========================
    [http://dropboxmq.sourceforge.net/]

  • JMS event generator only gets non-transactional queue msg

    Hi,
    I have created a JMS event generator to listen to a particular queue. It seems to work perfectly fine if, when posting a message to the queue that the JMS EG is listening to, the queue created is a non-transactional queue, i.e. queueConnection.createQueueSession(false, ...).
    However if I created a transactional queue to post message to the JMS EG, i.e. queueConnection.createQueueSession(true, ...), then the JMS EG can't seem to see the message. I checked in the WLI Admin console, JMS EG section, and there are no messages read by the particular JMS EG after I have posted the msg to the queue.
    My question is: is there a known limitation on the JMS EG that it can only read from a non-transactional JMS queue, or is this a bug? (I am using weblogic 8.1 sp2).
    Thanks
    Regards,
    xlfhk

    Hi,
    sorry, just discovered it's my mistake. Instead of using the transaction created when calling queueConnection.createQueueSession(true, ...), and committing that, I created a JTA transaction artificially wrapping the entire chunk of code.
    As a result, I ended up with a pair of transactions that are nested (I think ...), and the external transaction's commit was called when the nested JMS transaction hasn't been committed yet. As a result, no commit ever took place (I think again ...).
    I have now tried calling queueSession.commit() after sending the message. It seems to work fine. Thanks for the help.
    Regards,
    xlfhk.

  • Report and Alert don't executed in the error handler with a JMS proxy service

    Hi,
    I'm working with OSB 11.1.1.4.0 and I'm facing a problem with the error handler of my JMS proxy service.
    My error handler contains two main elements :
    - a Report action
    - an Alert with a JMS destination defined
    When the business service failed the message remain in the queue. It's the expected behavior.
    The problem is :
    - the report is missing
    - the alert is raised but missing in the JMS destination defined in the Alert setting.
    I've noticed if I add a Reply with Failure or Success, Report and Alert are successfully executed.
    Unfortunately the message don't remain in the JMS queue.
    What can I do in order to have my report/alert done and the JMS transaction rollback in order to keep the message in the queue ?
    I've already met this problem in the past with alsb v3 and my solution was to add Service Callout in the error handler in order to externalize these actions.
    This solution is not convenient and I hope another solution is possible.

    Inventorying workgroups can be difficult, especially when it comes to remote access and network security. Because workgroups are not centrally managed, some of the items discussed in this
    wiki article on preparing your workgroup environment may require you to visit each machine individually.
    For non-domain credentials, you do not use the <systemname>\<user> format, you simply enter the user name. Regarding how to enter the credentials, if you have an account that uses the same username and password on all machines and is an administrator
    on all of those machines, then you can enter that in the All computers credentials page of the wizard. You can also do this if they are different user names. However, if some machines have an account with the same user name, such as Administrator,
    but different passwords on each machine, you will need to use the Manually enter computer names discovery method, and then enter the information for each group or each machine.
    As you can tell, workgroup environments can quickly negate any benefit that the agentless inventory nature of MAP provides.
    Please remember to click "Mark as Answer" on the post that helps you, and to click
    "Unmark as Answer" if a marked post does not actually answer your question. Please
    VOTE as HELPFUL if the post helps you. This can be beneficial to other community members reading the thread.

  • Server boot takes a lot of time due to JMS persistence file store

    Hi,
    We're using WebLogic 9.2 on a windows machine.
    Recently, we enhanced our application to work with JMS.
    We're using 2 JMS servers on 2 different servers in a cluster, and working with distributed destinations.
    We're using file store as our persistence store.
    Lately, we found that server boot takes a lot of time due to actions which are performed on the file-store.
    Analyzing this problem, we saw that the file size is ~2GB.
    We understand that the file size does not shrink (unless manually compacted), and its size is matching the highest number ever of pending messages in the queues (like a high water-mark).
    We also turned store debug on, using weblogic.Debug.DebugStoreIOPhysical, and we saw a lot of recovery logs after the file-store is opened.
    We've checked and verified that our JMS transactions are completed successfully. We also verified that the number of pending and current messages is 0.
    We've stopped the server gracefully, verifying there are no pending messages.
    However, server boot repeatedly takes ~30 minutes due to heavy work done on the persistence store.
    Compacting or removing the file store eliminates the delay.
    However, we want to avoid manual operations every time we want to boot the server.
    Please share your ideas.
    Thanks,
    Itsik

    The only suggestions I have off the top of my head are:
    * Ensure (1) the host system has at least 2GB (file store size) of free physical memory in addition to the memory used by current processes, and (2) the host system is not rebooted between each WebLogic restart. If you make sure of these two items, then the operating system will implicitly cache the store's file contents in memory even between boots -- when WebLogic subsequently boots the file store, the O/S should serve the file contents up much more quickly.
    * Consider moving to a JDBC store. JDBC store runtime performance is lower, but since you have a typically only have a small amount of records to recover, boot performance should be higher in this case.
    * Not that it helps your particular case, but it happens that we have boot performance enhancements in process for a future release (hopefully a near future release).
    Tom

Maybe you are looking for