Send message in a non-transactional context

I've coded a simple Log4j appender to send error messages to a queue (JMSAppender provided by Log4J is not good for me because it use a publish/subscrive model and use topics instead of queues); the appender has to work in a non transactional context, so the appender has to send always the message to queue although the global transaction rollbacks; I've create queue session settings transacted parameter to false and acknowledgeMode to AUTO_ACKNOWLEDGE , but message is not delivered to queue if the global transaction, started by an EJB Stateless Session Bean, rollbacks; in my environment (IBM WebSphere and IBM MQ), queue connection factory is configured no-XA resource.
Any suggestions?
Below the source code.
Thanks in advance
context = new InitialContext();
queueFactory = (QueueConnectionFactory) context.lookup(getQueueConnectionFactoryBindingName());
queueConnection = queueFactory.createQueueConnection();
queueSession = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
queue = (Queue) context.lookup(getQueueBindingName());
queueSender = queueSession.createSender(queue);
queueConnection.start();Rob

I've coded a simple Log4j appender to send error messages to a queue (JMSAppender provided by Log4J is not good for me because it use a publish/subscrive model and use topics instead of queues); the appender has to work in a non transactional context, so the appender has to send always the message to queue although the global transaction rollbacks; I've create queue session settings transacted parameter to false and acknowledgeMode to AUTO_ACKNOWLEDGE , but message is not delivered to queue if the global transaction, started by an EJB Stateless Session Bean, rollbacks; in my environment (IBM WebSphere and IBM MQ), queue connection factory is configured no-XA resource.
Any suggestions?
Below the source code.
Thanks in advance
context = new InitialContext();
queueFactory = (QueueConnectionFactory) context.lookup(getQueueConnectionFactoryBindingName());
queueConnection = queueFactory.createQueueConnection();
queueSession = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
queue = (Queue) context.lookup(getQueueBindingName());
queueSender = queueSession.createSender(queue);
queueConnection.start();Rob

Similar Messages

  • Message redelivery with non-transactional message bean JMS standard or weblogic standard?

    It is my understanding (or maybe my assumption) that a message is
              re-queued only if the transaction attribute of a container-managed
              message bean is set to "Required" and the message is PERSISTENT. So if
              it's set to "NotSupported", and thus, message receival is not within a
              transaction, the message would be un-queued and thus never be
              redelivered, should a failure occur within the bean. I discovered that
              even if the message bean is set as "NotSupported", should a failure
              occur within the bean, the message is re-queued to be received again
              at a later time.
              I'm very confused as to whether this mechanism is a JMS standard, or a
              feature of Weblogic. Well, maybe I'm just confused about message
              delivery/re-delivery. I understand that the JMS standard requires
              guaranteed delivery of a message to a receiver. Does this mean a
              message is only considered delivered if an acknowledgement is
              received, regardless of the transaction level? In other words, is the
              JMS standard that a message is considered delivered only if
              acknowledgement is indicated through the container, regardless of the
              transaction level of the message bean itself?
              

    You're right on the second part. That is, a JMS message is not considered to
              be "delivered" until it is acknowledged. There are a number of ways to make
              this happen when programming to the raw JMS API -- a look at the Javadoc for
              JMS or a good JMS book should clarify how to do this.
              With a message-driven bean, the EJB container acknowledges the message after
              you've successfully returned from the "onMessage" method. If you throw a
              RuntimeException from the "onMessage" method, or if it's an MDB with a
              transaction mode of "Required" and you call "setRollbackOnly" on the
              "MessageDrivenContext" object -- then your message will be redelivered.
              Regardless of how a message is acknowledged, if it's not acknowledged then
              it will be redelivered. This has nothing to do with whether the message is
              persistent. The difference is that if a message is persistent, then the JMS
              server is required to keep a copy on stable storage until the message is
              acknowledged so that if the JMS server itself crashes, the message will not
              be lost. For a non-persistent message, on the other hand, if the JMS server
              crashes, then the message may be lost.
              greg
              "Justin" <[email protected]> wrote in message
              news:[email protected]...
              > It is my understanding (or maybe my assumption) that a message is
              > re-queued only if the transaction attribute of a container-managed
              > message bean is set to "Required" and the message is PERSISTENT. So if
              > it's set to "NotSupported", and thus, message receival is not within a
              > transaction, the message would be un-queued and thus never be
              > redelivered, should a failure occur within the bean. I discovered that
              > even if the message bean is set as "NotSupported", should a failure
              > occur within the bean, the message is re-queued to be received again
              > at a later time.
              >
              > I'm very confused as to whether this mechanism is a JMS standard, or a
              > feature of Weblogic. Well, maybe I'm just confused about message
              > delivery/re-delivery. I understand that the JMS standard requires
              > guaranteed delivery of a message to a receiver. Does this mean a
              > message is only considered delivered if an acknowledgement is
              > received, regardless of the transaction level? In other words, is the
              > JMS standard that a message is considered delivered only if
              > acknowledgement is indicated through the container, regardless of the
              > transaction level of the message bean itself?
              

  • Why won't my iPhone send messages to another non-iPone?

    My iPhone will send A text message to another iPhone, but fails when a message is sent to any non-iPhone. Help?

    Check Settings>Messages, turn Send As SMS to On.  If it's already on you may want to check with your carrier to be sure that your messaging plan is properly provisioned.

  • I have been trying to send messages from my Non Apple friends/family from my I Pad.  How do I get this to work??

    I have been trying to send my Non Apple friends/family messages from my I Pad.  How do I get this to work??

    It won't. iMessage isn't an SMS service. It's for Apple-to-Apple and uses cellular data. SMS uses a cellular SMS plan, which does not come with your iPad. You'd have to have a cell phone to send texts like that. Alternatively, you can find an instant messaging app like Skype (they do messaging, not just video chat) or MSN Messenger that goes across platforms. You install it, they install it, you can chat with them.

  • OVI Store and sending messages to me [none arrive ...

    Hi,
    I've had to delete some apps and that from my phone to be able to free up some space on the C drive and when i'm online via the laptop and signed into the OVI store there's a few features like sending links of apps to your phone via sms, and also backing up the phone via the MMS message that your supposed to recieve once you click on "send to phone" etc...any ideas why i can't get these or don't get these messages.
    Installing apps via the lap top is much easier than via the mobile.

    That feature is not currently supported.

  • IPhone trying to send message as iMessage to non-iOS recipient

    When I create a new message, I select the contact (who has a non-iOS device, in this case a Samsung Galaxy), the contacts name is green, which is fine.
    When I select the green contact's mobile number, the banner at the top goes from "New Message" to "New iMessage", the name stays green, but after typing a message the "Send" button remains greyed out so I cannot send it.
    I don't know why the iPhone is trying to send this as an iMessage when it clearly knows full well that the recipient is non-iOS (as the contact name is green).
    I have an iPhone 4s on iOS 7.1

    Hey there Barkster,
    It sounds like you are unable to send messages to a non iOS device when creating a new message. I would use the following troubleshooting from the following article:
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    To resolve issues sending and receiving SMS, follow these steps
    Go to Settings and turn airplane mode off.
    Make sure that you have a cellular network signal in the status bar of your iPhone. If there's no signal, learn more about troubleshooting no service.
    Restart your iPhone.
    Tap Settings > General > Reset > Reset Network Settings on your iPhone.
    Remove your SIM card and insert it again.
    If you still can't send or receive SMS, follow these steps
    Make sure that the contact who's trying to message you isn't blocked in Settings > Messages > Blocked.
    Make sure that you're using the area code with the contact's phone number. When sending messages internationally, you also need to use the contact's international code.
    If you're using a "Pay as you go" SMS plan, make sure it has enough available balance. Contact your carrier if you're unsure of your SMS plan or the available balance.
    If the issue occurs with a specific contact or contacts, back up or forward important messages and delete your current messaging threads with the contact. Create a new message to the contact and try again.
    If the issue occurs with a specific contact or contacts, delete and recreate the contact from the Contacts app. Send a new message to the contact.
    Back up and restore your iPhone as new.
    If your carrier has recently ported your phone number, the porting process might not be complete. Contact your carrier to confirm that the porting process is complete.
    Contact your carrier to confirm that you're provisioned for sending SMS and are in an area with cellular coverage.
    Contact your carrier to verify there are no blocks or filters placed on your wireless account preventing you from sending SMS.
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • Sending message to a JMS queue and making DB update through a single container managed transaction

    Can we use container managed transactions to send message to JMS queue and make DB updates in a sigle transaction. If yes then do we need 2pC license. I am using weblogic 6.0 SP2 and my database driver do not supports XA

    If your JMS provider is XA compliant, you can.
    If you are using WebLogic 6.0 JMS, it supports 2PC.
    The JDBC resource that does not support XA can participate in the global transaction
    creating a TXDataSource and setting "enable two-phase commit"=true in the Configuration
    panel.
    About the JMSConnectionFactory, on the console, in WebLogic 6.0, in the "Transaction"
    tab folder, set "User Transactions Enabled"=true.
    In your code, use non-transacted sessions.
    For 2pc protocol, you need a license or you'll get an exception.
    Sergi
    Manoj Bansal <[email protected]> wrote:
    Can we use container managed transactions to send message to JMS queue and
    make DB updates in a sigle transaction. If yes then do we need 2pC license.
    I am using weblogic 6.0 SP2 and my database driver do not supports XA

  • I cannot send a message to a non-apple phone and an apple phone in a group message. Both of the names will turn green as though they are non-apple phones, even when one is an apple user.

    I cannot send a message to a non-apple phone and an apple phone in a group message. Both of the names will turn green as though they are non-apple phones, even when one is an apple user. I am on iPhone 6. It also happens on my mom's iPhone 5s.

    Send messages with your iPhone, iPad, or iPod touch - Apple Support
    iOS: Troubleshooting Messages - Apple Support
    Send a group message with your iPhone, iPad, or iPod touch - Apple Support

  • TS5185 My IPAD will not send messages to non APPLE users.

    Today, Christmas Day, while trying to send a message my IPAD wanted me to turn on iMessage. There was no option not to do this. After it was turned on I could no longer send messages to non Apple users. After reading online that I could set send SMS on my IPHONE I did. Now I guess it send everything as an SMS message. Now my IPAD will not send messages to non Apple users. I guess Apple wants us to pick our friends only if the use Apple products. This is about as stupid as it gets. They want us to only communicate with Apple users. The only other option is to turn the feature off. Why have iMessage in the first place.
    So my situation is I can send SMS Messages on my IPHONE. I cannot send any messages to non Apple users on my IPAD and iMessages to my Apple users.
    This kind of stupidity is why I switched from Windows to Apple in the first place. Don't they test anything out anymore at Apple?

    Please don't take this the wrong way, but I think that you might be doing something wrong.
    Connect your iPhone, iPad, iPod touch, and Mac using Continuity - Apple Support
    To use Continuity for SMS and MMS with your iPhone and your Mac, iPad or iPod touch
    Your iPhone, iPad, and iPod touch need to use iOS 8.1, and your Mac needs to use OS X Yosemite.
    Sign in to iMessage on your iPhone, your other iOS devices, and your Mac using the same Apple ID.
    On your iPhone:
    Go to Settings > Messages > Send & Receive > You Can Be Reached By, and add a check to both your phone number and email address.
    Go to Messages > Text Message Forwarding, and enable the device(s) you would like to forward messages to.
    Your Mac, iPad, or iPod touch will display a code. Enter this code on your iPhone to verify the SMS feature.

  • You can't send SMS or text messages to a non-Apple phone (such as an Android, Windows, or BlackBerry phone), because the messages are sent as iMessage

    You can't send SMS or text messages to a non-Apple phone (such as an Android, Windows, or BlackBerry phone), because the messages are sent as iMessage

    Yes, you can. I do it many, many times a day. If you're trying to send a message to someone who used to have an iPhone and who didn't disable iMessage before switching phones, they will need to unregister their number with iMessage:
    https://selfsolve.apple.com/deregister-imessage
    You also need to have SMS enabled with your carrier to send messages to non-iPhones.

  • Transaction F.5D send message a breakdown is already running for company co

    Whe I try to run the transaction F.5D send message A breakdown is already running for company code 1600 and I can't run again for this compnay code the calculate Balance Sheet Adjustment on other  hand  I see in standar table RF180 that the process in not finished since 1 day what i have to do to finish this run created?
    Thanks!
    Edited by: Otoniel Trevino on Oct 30, 2008 12:53 AM

    Hi,
           Check the Transaction Code : SM04 if still the t.code F.5d is running terminate that, or ask BASIS consultant to terminate the run.
    Regards,
    SudhaReddy.

  • HT3529 Will iMessage send messages to non Apple phones? If so, is it automatic or do I have to keep changing settings?

    Will iMessage send messages to non Apple phones? If so, is it automatic or do I have to keep changing settings?

    If the recipient does not have an iOS device (or Mac) with iMessage activated on it, then it will send as SMS or MMS as appropriate. You don't need to change any settings.
    The only time you'll run into an issue is sending to someone who used to have an iDevice and neglected to turn off iMessage when they got something else. They will have to address that so that you don't have to forcibly send messages as SMS/MMS.

  • How do I send non-transacted from an transacted onMessage?

    I am having difficulties sending a message from within an transacted
              onMessage() (TX=req) in such a way that the send operation will
              not be part of the running transaction. In particular, I want the
              message to become visible immediatly for delivery to the
              destination MDB, not only after the current onMessage is done.
              I tried
              sess = qConnect.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
              (just because I was desperate; My understanding is that this should
              explicitly respect the running TX)
              as well as
              sess = qConnect.createQueueSession(true, 0);
              to no avail.
              Using
              sess = qConnect.createQueueSession(true, 0);
              and calling
              sess.commit();
              right after the send operation causes:
              javax.ejb.EJBException: nested exception is: javax.jms.TransactionInProgressException: Error commiting session
              at a.b.FooMDB.onMessage(Ljavax.jms.Message;)V(Unknown Source)
              at weblogic.ejb20.internal.MDListener.execute(Lweblogic.kernel.ExecuteThread;)V(Unknown Source)
              at weblogic.ejb20.internal.MDListener.transactionalOnMessage(Ljavax.jms.Message;)V(Unknown Source)
              at weblogic.ejb20.internal.MDListener.onMessage(Ljavax.jms.Message;)V(Unknown Source)
              at weblogic.jms.client.JMSSession.onMessage(Ljavax.jms.MessageListener;Lweblogic.jms.common.MessageImpl;)V(Unknown Source)
              at weblogic.jms.client.JMSSession.execute(Lweblogic.kernel.ExecuteThread;)V(Unknown Source)
              at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(Unknown Source)
              at weblogic.kernel.ExecuteThread.run()V(Unknown Source)
              at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Source)
              It seems like JMS wants to exclusively taking care of committing the
              session.
              Or does the problem have nothing to do with the createQueueSession()? Any hints?
              Kai
              

    Just to be clear, you receive a message in a MDB which has the Required
              transaction attribute and you want that MDB to publish a message to
              another destination. And you don't want the publish to participate in
              the current tx.
              I'd recommend that you have your MDB call a stateless session bean which
              has a NotSupported Method. In the NotSupported method you can do the
              publish. The EJB container will handle suspending the current tx before
              the NotSupported method and resuming it afterward.
              -- Rob
              Kai Juse wrote:
              > I am having difficulties sending a message from within an transacted
              > onMessage() (TX=req) in such a way that the send operation will
              > not be part of the running transaction. In particular, I want the
              > message to become visible immediatly for delivery to the
              > destination MDB, not only after the current onMessage is done.
              >
              > I tried
              > sess = qConnect.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
              > (just because I was desperate; My understanding is that this should
              > explicitly respect the running TX)
              > as well as
              > sess = qConnect.createQueueSession(true, 0);
              > to no avail.
              >
              > Using
              > sess = qConnect.createQueueSession(true, 0);
              > and calling
              > sess.commit();
              > right after the send operation causes:
              > javax.ejb.EJBException: nested exception is: javax.jms.TransactionInProgressException: Error commiting session
              > at a.b.FooMDB.onMessage(Ljavax.jms.Message;)V(Unknown Source)
              > at weblogic.ejb20.internal.MDListener.execute(Lweblogic.kernel.ExecuteThread;)V(Unknown Source)
              > at weblogic.ejb20.internal.MDListener.transactionalOnMessage(Ljavax.jms.Message;)V(Unknown Source)
              > at weblogic.ejb20.internal.MDListener.onMessage(Ljavax.jms.Message;)V(Unknown Source)
              > at weblogic.jms.client.JMSSession.onMessage(Ljavax.jms.MessageListener;Lweblogic.jms.common.MessageImpl;)V(Unknown Source)
              > at weblogic.jms.client.JMSSession.execute(Lweblogic.kernel.ExecuteThread;)V(Unknown Source)
              > at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(Unknown Source)
              > at weblogic.kernel.ExecuteThread.run()V(Unknown Source)
              > at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Source)
              >
              > It seems like JMS wants to exclusively taking care of committing the
              > session.
              >
              >
              > Or does the problem have nothing to do with the createQueueSession()? Any hints?
              >
              > Kai
              >
              

  • Can't send messages from iPad to non-Apple users

    After updating my iPad to iOS 7, I can no longer send messages to non-Apple devices.  I used to be able to send and receive text messages from my friends who use Android for example, but now it just says "not delivered".  Is anyone else experiencing this problem or know how to fix it?  By the way, it still works fine on my iPhone.  

    As far as I know, the native Messages app of the iPad was never able to send or receive SMS messages. SMS messages are a function of the voice portion of the cellular system, and even an iPad with celluler hardware connects only to the data portion of the cellular system.

  • My Iphone 4 isn't letting me send messages to non-Iphone users

    My phone is on a 60 dollar monthly plan, in which my father an I did not know. We went to walmart and purchased a $50 prepaid card. It worked at first, and then when I sent messages to ANYONE, I got a message saying: "You have insufficient funds to send message". I finally got fed up, and we went to Verizon. When there, the guy said that because I'm on a 60 dollar plan, that's why my phone has been acting funky, so he had us put 10 dollars into the account, hopping that it would even everything out, because I'm on a 60 dollar plan. Well. It was working fine, I was texting my friends and what not. One in particular was a non-iphone user, and now each time I try sending a message to any non-iphone user, the message fails and it tells me that I have insufficient funds. However, my phone sends messages just fine to other iphone users. Help please...

    It sounds as if you have insufficient funds on your account to send SMS messages. However, you apparently still have sufficient data to send iMessages. You'll need to contact Verizon and make arrangements either to add more money to your account or change your plan.

Maybe you are looking for