Acknowledge from jms

I have written two jms program (publisher/subscriber). Those are asynchronous. I want to know how can publisher know subscriber can receive the message succesful? Can subscriber reply a acknowledge to publisher?
<! ================ subscriber program ====================== >
import java.util.Hashtable;
import java.lang.Runtime;
import java.lang.*;
import java.io.*;
import javax.jms.*;
import javax.naming.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.jms.QueueConnectionFactory;
import javax.jms.TopicConnectionFactory;
import javax.jms.TopicConnection;
import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
import javax.jms.Topic;
import javax.jms.Message;
import javax.jms.TextMessage;
import javax.jms.Session;
import javax.jms.MessageListener;
import javax.jms.JMSException;
public class HelloSubscriber implements MessageListener {
TopicConnection topicConnection;
TopicSession topicSession;
TopicSubscriber topicSubscriber;
Topic topic;
public HelloSubscriber(String factoryJNDI, String topicJNDI) throws JMSException, NamingException
QueueConnection queueConnection = null;
try{
     Context context = new InitialContext();
     TopicConnectionFactory topicFactory = (TopicConnectionFactory)context.lookup("ConnectionFactory");
     topicConnection = topicFactory.createTopicConnection();
     topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
     topic = (Topic)context.lookup(topicJNDI);
     topicSubscriber = topicSession.createSubscriber(topic);
topicSubscriber.setMessageListener(this);
     System.out.println("HelloSubscriber subscribed to topic: " + topicJNDI);
     topicConnection.start();
} catch (NamingException nEx){
System.out.println(nEx.toString() + "\nDoes the queue exist?");
System.exit(1);
public void onMessage(Message m) {
try {
     String msg = ((TextMessage)m).getText();
}catch(JMSException ex) {
     System.err.println("Could not get text message: " + ex);
     ex.printStackTrace();
public void close() throws JMSException {
topicSession.close();
topicConnection.close();
public static void main(String[] args) {
try {
     HelloSubscriber subscriber = new HelloSubscriber(
     // Name of ConnectionFactory
     "TopicConnectionFactory",
     // Name of destination to publish to
     "topic/testTopic"
}catch(Exception ex) {
     System.err.println("An exception occured while testing HelloPublisher: " + ex);
     ex.printStackTrace();
} // HelloSubscriber

You can do this by having the publisher set the ReplyTo field in the message header, which the subscriber must subsequently reply to when it has successfully processed the message. Both ends have to be both publishers and subscribers for this to work. You can also look into using the TopicRequestor at the publisher end. You may want to write your own topic requestor that doesn't use a temporary topic if you need the reply/acknowledgement message to be persistent.
- Bjarne.

Similar Messages

  • Persistent messages are not deleted from JMS store

              Hi,
              I'm experiencing some unexperienced JMS store behaviour with WLS 6.1 sp 4. I have
              a servlet that posts a message to persistent JMS queue, which will be eventually
              consumed by an MDB. Even though consumption is successful, the message is not
              deleted from JMS store.
              The message will be redelivered after server restart and is still not deleted
              from JMS store. I verified this using file store and JDBC store. The messages
              actually stay in the JMSSTORE table till doom's day.
              I couldn't reproduce the case with WLS 6.1 sp 3. Exactly the application code
              was used in all cases.
              Subsequently I ran the same case with various ServerDebug DebugJMSXXX-flags set,
              and discovered that WLS 6.1 sp3 logs 'asyncDeleteL' and 'ZZZDelete' for the consumed
              message. WLS 6.1 sp4 didn't log this information.
              I'm running WLS 6.1 on WinNT and Win2000.
              Comments?
              b r
              Juha Räsänen
              

    I've am having exactly this problem with wl 5.1....
              I first saw it with 5.1 sp8....
              In the release notes for 5.1 sp10, the following CR was fixed, which seemed
              like it might have been my problem:
              CR 45915
              Fixed a JMS problem with messages begin left in the queue after received messages had been acknowledged. When a high volume of
              messages was sent to a queue and a consumer retrieved those messages and sent them to another queue, the messages were not being
              removed from the first queue even though they were acknowledged.
              We upgraded to 5.1 sp12, and it appeared that the incidence of that problem was reduced.
              However it still occurs once or twice a week, with 5.1 sp12....
              My situation is a little bit different, in that my consumer retieves a message, and sends another
              message to the SAME queue instead of another queue as described in the CR above...
              It does happen under heavy load, etc....
              Don't know if this has been reported and identified for wl 5.1 sp12 or not...
              It is of course a really difficult to deal with bug....
              Jason
              "Juha Räsänen" <[email protected]> wrote in message news:[email protected]...
              >
              > Hi,
              > I'm experiencing some unexperienced JMS store behaviour with WLS 6.1 sp 4. I have
              > a servlet that posts a message to persistent JMS queue, which will be eventually
              > consumed by an MDB. Even though consumption is successful, the message is not
              > deleted from JMS store.
              >
              > The message will be redelivered after server restart and is still not deleted
              > from JMS store. I verified this using file store and JDBC store. The messages
              > actually stay in the JMSSTORE table till doom's day.
              >
              > I couldn't reproduce the case with WLS 6.1 sp 3. Exactly the application code
              > was used in all cases.
              >
              > Subsequently I ran the same case with various ServerDebug DebugJMSXXX-flags set,
              > and discovered that WLS 6.1 sp3 logs 'asyncDeleteL' and 'ZZZDelete' for the consumed
              > message. WLS 6.1 sp4 didn't log this information.
              >
              > I'm running WLS 6.1 on WinNT and Win2000.
              >
              > Comments?
              >
              > b r
              > Juha Räsänen
              

  • How can I send acknowledgement from B2B

    Hi,
    I want send acknowledgement from B2B. I don't want to sue As2 protocol. Can I send acknowledgement from B2B through file or JMS protocol? Is is possible in B2B?

    Hi Roshni,
    Please post Oracle B2B related queries in B2B forum -
    Integration - B2B
    AS2 is an exchange protocol which mandates the acknowledgement as part of it's specification, whereas File or JMS are transport protocols and hence no exchange level acks can be exchanged for these. Though both File and JMS have transport level acks and on the basis of transport level ack only, B2B considers whether a message has been sent successfully or not. If you need extra layer of ack then you may always use a functional ack.
    Regards,
    Anuj
    Edited by: Anuj Dwivedi on Feb 7, 2013 3:58 PM

  • Error in Accessing AQ Anydata queue containing LCRs from JMS

    Hello,
    I tried to access Anydata queue containing LCRs (captured by oracle stream capture process) configured in Oracle 10g 10.2.0.3.0 from JMS.
    I am getting following error:
    oracle.jms.AQjmsException: JMS-225: Invalid JDBC driver - OCI driver must be used for this operation
    SQL Code that I used configure in Oracle Streams
    BEGIN
    DBMS_STREAMS_ADM.SET_UP_QUEUE(
    queue_table => 'strmadmin.streams_queue_table',
    queue_name => 'strmadmin.streams_queue');
    END;
    BEGIN
    DBMS_STREAMS_ADM.ADD_TABLE_RULES(
    table_name => 'strmadmin.emp',
    streams_type => 'capture',
    streams_name => 'capture_emp',
    queue_name => 'strmadmin.streams_queue',
    include_dml => true,
    include_ddl => false,
    inclusion_rule => true);
    END;
    And few more SQL, which ensured few records in streams_queue_table.
    Java Code
    qc_fact = AQjmsFactory.getTopicConnectionFactory(host_, database_, port_, "thin");
    q_conn = qc_fact.createTopicConnection(user_, password_);
    q_conn.start();
    q_sess = q_conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
    Topic queue = ((AQjmsSession)q_sess).getTopic(_user, queue_);
    TopicReceiver receiver = ((AQjmsSession)q_sess).createTopicReceiver(queue, "EXPLICIT_DQ", null);
    Map map = ((AQjmsSession)q_sess).getTypeMap();
    // Register mapping for XMLType in the TypeMap - required for LCRs
    map.put("SYS.XMLTYPE", Class.forName("oracle.xdb.XMLTypeFactory"));
    //wait for a message to show up in the queue
    ObjectMessage message = (ObjectMessage)receiver.receive();
    I used aqapi13.jar as I couldnt find aqapli14.jar in my Oracle DB.
    Can some one pls suggest me what should I do to access AnyData AQ containing LCRs.
    Can some one send me aqapi14.jar to [email protected] , so that I can test with this jar.
    Thanks
    siva

    Hello,
    You need to use the OCI driver as the error indicates.
    The thin driver does not have support for the ANYDATA type in 10.2 only the OCI driver does. in 11.1 onwards the thin driver supports the ANYDATA type. So an option may be to use the jar files from an 11g install.
    Thanks
    Peter

  • Sender JMS Synchronous communication channel not picking up files from JMS

    Hello,
    One of our Sender JMS synchronous communication channel (used Sync/Async bridge in the module section to make it Synchronous) is not picking up files from JMS system though the channel looks to be active (greeen).
    When I am trying to stop the channel, it is giving error as "1 of 1 administered and selected channels have not been stopped", and after this when I start the cannel again it shows green but not picking up any files.
    if anyone is haivng any solution for this, please reply back.
    Thanks in advance.

    Messages available in JMS system? please check queue's if message were there and it is not picking up then some thing wrong with cc.
    simple solution create new communication channel with same details and try to use the same.

  • Jms adapter not polling messages from jms topic

    Hi
    We have a jms adapter configured in BPEL process which need to poll messages from JMS topic.Unfortunately its not polling message from JMS Topic if we add Message Selector and Durable Subscriber properties in jca file.Please find jca file content below
    <adapter-config name="SyncCustomerPartyListCDHJMSConsumer" adapter="JMS Adapter" wsdlLocation="oramds:/apps/AIAMetaData/AIAComponents/ApplicationConnectorServiceLibrary/CDH/V1/ProviderABCS/SyncCustomerPartyListCDHProvABCSImpl.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory location="eis/jms/aia/syncCustomerParty_cf" UIJmsProvider="WLSJMS" UIConnectionName="Dev"/>
      <endpoint-activation portType="Consume_Message_ptt" operation="Consume_Message">
        <activation-spec className="oracle.tip.adapter.jms.inbound.JmsConsumeActivationSpec">
          <!--property name="DurableSubscriber" value="XYZ"/-->
          <property name="PayloadType" value="TextMessage"/>
          <!--property name="MessageSelector" value="Target in ('XYZ')"/-->
          <property name="UseMessageListener" value="true"/>
          <property name="DestinationName" value="jms/aia/Topic.jms.COMMON.CustomerParty.PUBLISH"/>
        </activation-spec>
      </endpoint-activation>
    </adapter-config>
    If we remove Durable subscriber and message selector properties,its able to poll messages.
    Any pointer will help
    thanks in advance
    Baji

    After changing below property in jca file.JMS adapter is able to poll messages from JMS Topic.
    <property name="UseMessageListener" value="false"/>
    But if i un comment below line and deploy my code again, it stop pulling the messages from topic.
    <property name="DurableSubscriber" value="XYZ"/>
    If i bounce the server after above change and deployment ,it will start polling the message.I am not sure why i need to restart my server after adding above property.
    Thanks
    Baji

  • Acknowledgement from receiver file Adapter with out BPM

    Hi Gurus,
    I am trying to get Acknowledgement from Receiver file Adapter with out Using BPM.
    Here is the scenario. I am sending files from different Sender Adapters. There is only one target that is File Adapter. After each successfull and failure transaction I need an Acknowledgement that needs to trigger another receiver adapter and send the the file name and timestamp to that file.
    Hope this is a complicated scenario. Please help me.
    Thanks,
    Kevin

    from sap note 821267
    6. Acknowledgements
        * Q: Does the File Adapter support acknowledgements?
        * A: You need to distinguish system acknowledgements (indicating that a message has been received by the target system) and application acknowledgements (indicating that the message has been successfully processed by the application on the receiver side).
               The receiver of an XI message will only send an acknowledgement back to the sender if the sender has requested one. However, the File Adapter has no functionality that relies on the receipt of an acknowledgement, so it never requests one.
               On the other hand, if a File Adapter Receiver receives a request to send an acknowledgement, it will do so for a system acknowledgement request. Application acknowledgements are not supported at all as the File Receiver has no way to determine if the written file has been correctly processed by the back-end application, which is what a positive application acknowledgement would imply.
    this means that your requirement is ideally not possible without a BPM

  • Succesful IDOC acknowledgements from ECC

    Dear MDM gurus,
    What is the best way to handle acknowledgements from ECC (INTO MDM) for inbound IDOCS from MDM (MDM->XI->ECC).
    We want it such that when an IDOC gets posted into ECC succesfully,it should send an acknowledgement signal back to MDM saying that IDOC was received properly.
    Thanks.

    HI Mugdha,
    I have a concern on the Acknowledgement (ALEAUD) Idoc. I have implemented this scenario wherein DEBMAS IDoc is posted from MDM -PI - ECC and ECC sends back the acknowldgement using ALEAUD Idoc.
    However, in PI (SXMB_MONI) there is no separate message entry created for this acknowledgment. The ALEAUD acknowldgement message details is attached to the original DEBMAS message which was triggered from MDM - PI - ECC. Due to this, PI interface created is not able to read the acknowledgement message and process it to post/dump the target file onto the MDM Port.
    I tried triggering and ALEAUD Idoc manually using PI - RWB which generated a separate message for ALEAUD Idoc in sxmb_moni and then my target file was created in MDM (But this is just a manual way of testing the PI interface).
    Can you advice on how this concern can be dealt with?
    Thanks in advance,
    Elizabeth.

  • Acknowledgement from sql

    Hi experts,
    Actually what i want is i am writting one sql file ,in that file i am trying to update some rows of emp table. What is the requirement is is the updation is done then i have to perform one task or i have to perform another task .I am asking if is there any way to get the acknowledgement from sql whether an update statement has successfully executed or not.
    In unix we do the same thing via $? .
    I think i am clear.
    Regards
    Rajat

    What do you mean by Failing here?
    If the Update hits a Unique Key Constrain violation or violation of any other constraint then it will be raised.
    So the op has to define what Failing means here. If the op thinks not updating any row is failing then no error is going to be raised. But usually that is not considered as failing of an update statement.
    In that case SQL%ROWCOUNT will give the number of rows the current update statement has processed.
    Thanks,
    Karthick.

  • PO acknowledgement from vendor in system

    Hi gurus,
    PLease let me know the procedure for getting acknowledge from vendor for PO...
    Once po created , how to get acknowledge and what are settings required for the same.. how to use that option..
    plesae explain..
    thanks in advance

    Vendor Acknowledgment can be used with Confirmations Concept
    After Receiving PO, Vendor will notify you acknowledgment through mail/phone/ some other source.
    Then, in ME22N,   In the Item Details, Confirmations Tab (BELOW),
    You Acknowledge the materials,...
    Then only system will allow you to do GR in MIGO.
    You have to activate Confirmations In SPRO,and Vendor Master data
    Edited by: Anand K on May 1, 2008 3:17 PM

  • XI acknowledge from BPM

    HI Experts,
    Trying to make acknowledge from XI to R/3 through BPM but get error message “Unable to convert the sender service <BPM_Process> to an ALE logical”. The XI process flow is from SAP with Idoc to XI – BPM and to JDBC. Have check setting in Adapter specific identifier which has logical system.  Could experts have same experience before, please advice?
    Thanks in advance.
    Katjun

    Hey,
    Have you maintained all the ALE setting from R/3 to XI > and the Port on Idoc Adapter IDX1 >?  Once try to specify Adapter Specific identifier to the bpm process .
    <b>Cheers,
    *RAJ*
    *REWARD POINTS IF FOUND USEFULL*</b>

  • How to send application acknowledgement from R/3 system

    Hi guys,
          How to send application acknowledgement from R/3 system. Ex. we have post one IDoc and check user validations. Suppose date is wrong that means indicate earlier or wrong date but date format is correct. In this situation we need send one acknowledment to sender.
    How to find the solution? pls tell anyone.
    Regards
    Vijay

    Hi Vijay,
    Plz do perform the following steps:
    1) In the Integration Server, call transaction SE38
    2) Run program IDX_ALEREQUEST to process IDocs with message type ALEAUD as XI request
    message.
    3) Now Enter Sender Port, Sender Client,Partner Number, Partner Type, and Partner Rol
    4) In Integration Directory, configure the routing of interface
    5) Call transaction SXMB_MONI to display the XI message.
    Also,
    Further in IDX5 as well you will find entry for IDoc ALEAUD.ALEAUD01
    Please go through the link
    1)Succesful IDOC acknowledgements from ECC
    2)https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/903a0abc-e56e-2910-51a8-9dc616df56eb
    3)https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f6d2d790-0201-0010-9382-b50b499b3fbe
    After you triggered the IDoc by e.g. tcode: WPMA and IDoc reached FILE system, FILE receiver CC actually is only able to send acknowledgment types SystemErrorAck and AckNotSupported.
    This is because:
    - IDoc sender adapter requests the following acknowledgments:
    SystemAckRequested="false"
    SystemErrorAckRequested="true"
    ApplicationAckRequested="true"
    ApplicationErrorAckRequested="true"
    - File receiver adapter “that run on the Adapter Engine support system acknowledgments and system error acknowledgments if they are requested by the sender. These acknowledgments are triggered when a message is successfully processed by the adapter or if an error occurs while it is being processed.”
    If you haven’t suppressed acknowledgments for IDocs WP_PLU in IDX_NOALE in XI then you will get:
    SystemErrorAck – when message has not reached the FILE system
    AckNotSupported – for all others acknowledgement types
    QQ) Will this IDOC Ack applicable for this scenario???
    Rather not, since FILE adapter does not support any other acknowledgements then system and IDoc adapter does not request other acknowledgements then application + SystemErrorAckRequested.
    In sender system your IDoc will be always in status 39 (instead of 03), when acknowledgement is turned on.
    This is because:
    For SystemErrorAck the corresponding ALEAUD status is 56
    For AckNotSupported the corresponding ALEAUD status is 50
    Both inbound 56 and 50 statuses end up in 39 for your outbound IDoc in sender system.
    Q1) Will this ALEAUD Idoc contains any Message from File System????
    In both cases, it will result in status 39 - IDoc is in the target system. So it does not matter.
    Q2) Basically what Information will contain this IDOC Ack.
    Idoc number from sender system and status 56 or 50 depends on acknowledgement type.
    Q3) Do we receive any Info from the Target File System , if we implement this Ack concept??
    Nothing useful.
    Remember that “File Receiver has no way to determine if the written file has been correctly processed by the back-end application”. However, if your “FILE” application can read your WP_PLU message and after successful processing is able to generate any kind of message then you can acknowledge the communications but you will not be able to link original message with the acknowledgement request message.
    To do that you need to configure just normal scenario (that will be your new acknowledgement scenario) FILE -> XI -> R/3. Your FILE service will send ALEUAUD Idoc to R/3 system. Your FILE application must take care to generate proper ALEAUD XML message. In order to treat ALEAUD as a request message (not standard acknowledgement) you need to run IDX_ALEREQUEST in SE38 on XI.
    Q1) It means if the Idoc not reached to Target File system means we can able to get the System Error Ack to Sender SAP R/3 System. Am i Right????
    Supposed you have turned off acks on XI (tcode: se38, IDX_NOALE) for your sender port/client:
    You have sent the IDoc and the last status is "03 - Data passed to port OK"
    You don't know whether it was even delivered to XI ...
    Supposed you have turned on acks on XI (tcode: se38, IDX_NOALE) for your sender port/client.
    1)
    You send and IDoc and it has been delivered successfully to FILE system.
    Adapter Engine creates acknowledgement type: AckNotSupported
    In XI you can see Ack Status: AckRequestNotSupported (Acknowledgement not possible). Category: permanent.
    XI will send ALEAUD IDoc to R/3 system: status "50 - IDoc is added"
    The IDoc status in sender will be "39 - IDoc is in receiving system (ALE service)".
    2)
    You send and IDoc and it has not been delivered successfully to FILE system. e.g. FILE server is down.
    Adapter Engine creates acknowledgement type: SystemErrorAck
    In XI you can see Ack Status: Error (Acknowledgement contains system errors). Category: transient.
    XI will send ALEAUD IDoc to R/3 system: status "56 - IDoc with errors is added"
    The IDoc status in sender will be "39 - IDoc is in receiving system (ALE service)".
    So status 39 means only that IDoc reached XI, but you don't know whether it was delivered to FILE system or not.
    Q2) And one more thing is Even though we are dealing with the IDOCFile OR FileIDOC we can able to get the ACk of Type System Error Ack only. Am I Right?????
    No, "Sender adapters of the Adapter Engine do not request any acknowledgements."
    Q3) So the same case( Which we disscused for IDOCFile) is Applicable for FileIDOC also????
    No.
    Can we able to get the System Error Ack, if the File is not reached to SAP R/3( Target here)
    No.
    Q4) If Yes to Q3 means,Where this System Error Ack will be seen in File System side???
    Do we need to do any extra settings to receive these System Error Ack at File system side??
    Not relevant.
    Regards,
    Vinod.

  • GUI receiving log messages from JMS

    Hi,
    I have three classes: GUI, EventListener and JMSListener. What I want to do is to create a login dialog. The user enters his username and password, presses the login button and waits (as this process can take a while). While waiting, he can see log messages sent via JMS.
    I set up a TextListener (in my case a JMSListener) and a subscriber like it is described here: http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/client.html#1027256.
    But the JMSListener never gets any message although the connection is set up correctly (this is just a guess as no exception is thrown). I think that this is a GUI problem. Because if only the JMSListener is running, it does receive messages. Is it possible that the GUI blocks somehow?
    Here is some code... First the class that holds the main method:
    package de.dtnet.client.run;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    import de.dtnet.client.gui.SWDemoGUI;
    import de.dtnet.client.listener.SWDemoEventlistener;
    public class SWDemoClient {
        private static SWDemoGUI swdemo = null;
         * @param args
        public static void main(String[] args) {
            swdemo = new SWDemoGUI();
            SWDemoEventlistener listener = new SWDemoEventlistener(swdemo);
            swdemo.registerEventlistener(listener);
    }The code from the GUI (only the important parts):
    package de.dtnet.client.gui;
    import de.dtnet.client.listener.SWDemoEventlistener;
    public class SWDemoGUI extends JFrame implements Serializable {
        private static final long serialVersionUID = 1L;
         * Default constructor
        public SWDemoGUI() {
            initialize();
         * Creates widget objects and puts everything together
        public void initialize() {
            // GUI with JTextPane for log messages
        public void logOK(String msg) {
            log(OK, msg);
        public void logInfo(String msg) {
            log(INFO, msg);
        public void logWarning(String msg) {
            log(WARNING, msg);
        public void logError(String msg) {
            log(ERROR, msg);
        public void log(String level, String msg) {
            StyledDocument doc = messagesTextPane.getStyledDocument();
            try {
                doc.insertString(doc.getLength(), msg + "\n", doc.getStyle(level));
            } catch (BadLocationException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            messagesTextPane.setCaretPosition(doc.getLength());
        public void registerEventlistener(SWDemoEventlistener listener) {
            loginBtn.addActionListener(listener);
            usernameTxt.addFocusListener(listener);
            passwordField.addFocusListener(listener);
    }The enventlistener:
    package de.dtnet.client.listener;
    // imports
    public class SWDemoEventlistener implements ActionListener, FocusListener {
        private SWDemoGUI gui = null;
        private String logLevel = null;
        private String logMessage = null;
        private TopicConnectionFactory conFactory = null;
        private TopicConnection connection = null;
        private TopicSession topicSession = null;
        private Topic topic = null;
        private TopicSubscriber subscriber = null;
        public SWDemoEventlistener(SWDemoGUI gui) {
            this.gui = gui;
            initJMS();
        private InitialContext getInitialContext() {
            // set the properties for the InitalContext
            Properties env = new Properties( );
            env.put("java.naming.provider.url",
                    "jnp://localhost:1099");
            env.put("java.naming.factory.initial",
                    "org.jnp.interfaces.NamingContextFactory");
            env.put("java.naming.factory.url.pkgs", "org.jnp.interfaces");
            try {
                // initalize and return the InitalContext with
                // the specified properties
                return new InitialContext(env);
            } catch (NamingException ne) {
                System.out.println("NamingException: " + ne);
            return null;
        private void initJMS() {
            try {
                // Obtain a JNDI connection
                InitialContext jndi = getInitialContext();
                Object ref = jndi.lookup("ConnectionFactory");
                // Look up a JMS connection factory
                conFactory = (TopicConnectionFactory) PortableRemoteObject.narrow(
                        ref, TopicConnectionFactory.class);
                // Create a JMS connection
                connection = conFactory.createTopicConnection();
                // Create a JMS session objects
                topicSession = connection.createTopicSession(
                        false, Session.AUTO_ACKNOWLEDGE);
                // Look up a JMS topic
                topic = (Topic) jndi.lookup("topic/testTopic");
            } catch (NamingException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (JMSException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
        public void actionPerformed(ActionEvent e) {
            if (e.getSource() == gui.getLoginButton()) {
                // Do some authentication stuff etc.
                /* Now awaitening messages from JMS */
                subscribe(sessionID);
        public void subscribe(Long sessionID) {
            String selector =  "SessionID='" + sessionID.toString() + "'";
            gui.logInfo("Selector: " + selector);
            try {
                //subscriber = topicSession.createSubscriber(topic, selector, true);
                subscriber = topicSession.createSubscriber(topic);
                JMSListener listener = new JMSListener(gui);
                subscriber.setMessageListener(listener);
                connection.start();
                gui.logOK("Verbindung zu JMS erfolgreich");
            } catch (JMSException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
    }and finally the JMSListener:
    ackage de.dtnet.client.listener;
    public class JMSListener implements MessageListener {
        private SWDemoGUI gui = null;
        private String logLevel = null;
        private String logMessage = null;
        public JMSListener(SWDemoGUI gui) {
            super();
            this.gui = gui;
        public void onMessage(Message incomingMessage) {
            System.out.println("You got message!");
            try {
                MapMessage msg = (MapMessage) incomingMessage;
                logMessage = msg.getString("Message");
                logLevel = msg.getString("Level");
            } catch (JMSException e) {
                e.printStackTrace();
            Runnable logTopicMessage = new Runnable() {
                public void run() {
                    System.out.println("Now updating the GUI");
                    gui.log(logLevel, logMessage);
            SwingUtilities.invokeLater(logTopicMessage);
            System.out.println("Message fully retrieved!");
    }I spent a whole day on this and I'm really becoming desperate as I can't see where the problem is and my time is running out (this is for my diploma thesis)! Does anyone of you? Please!
    Thank you!
    -Danny

    Hello Veronica4468,
    After reviewing your post, I have located an article that can help in this situation. It contains a number of troubleshooting steps and helpful advice concerning Messages and SMS:
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • What ESB adapter can pass a message from JMS service to outside service?

    1. we are running ESB from SOA 10.1.3.1 on linux
    2. we have XML message passed to JMS deployed at the local OC4J
    3. we need this XML message passed to an outside service.
    What will be the adapter to use as outbound from JMS?
    TIA

    What is this outside service, if it is a web service then you can use SOAP adapter. just put in the WSDL and away you go.
    Use the JMS adapter for reading the queue and the SOAP adapter for writing to outside service.
    cheers
    James

  • Debatching is possible when we are reading messages from JMS queue

    Hi all,
    If i place a message in a queue can i read the message from JMS using BPEL ( JMS Adapter ) or OSB( JMS Transport ) like batcth rather than reading the whole message in to the OSB or BPEL at the same time .
    is this option is available in OSB/BPEL ??
    Thanks
    Phani

    Hi all,
    If i place a message in a queue can i read the message from JMS using BPEL ( JMS Adapter ) or OSB( JMS Transport ) like batcth rather than reading the whole message in to the OSB or BPEL at the same time .
    is this option is available in OSB/BPEL ??
    Thanks
    Phani

Maybe you are looking for

  • Call forward to VM not working

    Hi All; we have switched from TDM to SIP trunk. after that call forward to voicemail and also automated attendant don't work. then I changed VM pilot number to full number instead of 6000. still when inbound call is received, and called party doesn't

  • Airport extreme, audio won't work on windows 7 boot camp for my macbook pro osx lion

    Bought my Macbookpro in late 2011 and osx lion, decided to put boot camp on it, but it won't find my airport exrteme or even if i connect the ethernet cord directly into the laptop it still wont conectto the internet, and my audio also doesn't work,

  • Solution manager monitering activities

    Hi all, can anybody please help me out on solution manager daily,weekly and monthly activities. please............... thanx in advance. vinnu.

  • Varying result set and binding parameters in sqlcmd from variable

    SSIS  - Support of Multiple versions of our product Our Enterprise Data warehouse consolidates data from multiple data sources.  We have a requirement that we should be able to support data collection from different version of these data sources at t

  • Discovering a NAS based file server fails

    I am trying to add an EMC NAS device to use as a Repository. Under the Storage tab in Oracle VM Manager 3.1.1, I am doing a "Discover File Server". The discovery portion of this actually succeeds. It is when this process does a "Refresh File System"