JMS Message ID retrieval using Java

Hi,
I have built a flow the sequence which is JMS Producer(BPEl)->JMS Consumer(Bpel)->A Bpel composite inserting into database. Now i have deliberately faulted the bpel instance. now i want to capture the faulted consumer bpelcomposite instance id which i have been able to do as well as retrieve the jms message id which i have been unsuccessful.
i have imported the package javax.jms.Message and my code is as follows
public class FaultHandlingPOC implements IFaultRecoveryJavaClass{
public void handleRetrySuccess(IFaultRecoveryContext ctx) { 
System.out.println("This is for retry success");
handleFault(ctx);
public String handleFault(IFaultRecoveryContext ctx) {
BPELFaultRecoveryContextImpl bpelCtx = (BPELFaultRecoveryContextImpl) ctx;
Message m = (Message)ctx;
System.out.println("Composite Instance: " + bpelCtx.getCompositeInstanceId());
try {
System.out.println("JMS Message ID" + m.getJMSMessageID());
} catch (JMSException e) {
System.out.println("Insert Failed");
return "RETHROW";
The error generated is Class Cast Exception though i am able to retrieve the Bpel composite instance id
Please help.

you can't cast IFaultRecoveryContext into anything else, it's an Interface and it doesn't extend anything:
public interface IFaultRecoveryContext
public abstract String getIndex(int i);
public abstract Map getProperties();
public abstract String getActionId();
public abstract String getPolicyId();
public abstract String getActivityType();
public abstract String getActivityId();
public abstract String getActivityName();
public abstract String getWsdlLocation();
public abstract String getPartnerLinkName();
public abstract QName getPortType();
public abstract String getCorrelationId();
public abstract BPELFault getFault();
public abstract BPELProcessId getProcessId();
public abstract String getStatus();
public abstract void setStatus(String s);
public abstract String setTitle(String s);
public abstract String getTitle();
public abstract int getPriority();
public abstract void setPriority(int i);
public abstract long getInstanceId();
public abstract Locator getLocator();
public abstract void addAuditTrailEntry(String s, Object obj);
public abstract void addAuditTrailEntry(String s);
public abstract void addAuditTrailEntry(Throwable throwable);
public abstract Object getVariableData(String s)
throws BPELFault;
public abstract Object getVariableData(String s, String s1)
throws BPELFault;
public abstract Object getVariableData(String s, String s1, String s2)
throws BPELFault;
public abstract void setVariableData(String s, Object obj)
throws BPELFault;
public abstract void setVariableData(String s, String s1, Object obj)
throws BPELFault;
public abstract void setVariableData(String s, String s1, String s2, Object obj)
throws BPELFault;
}

Similar Messages

  • Dequeuing a Map message from AQ using Java/JMS

    I have a queue in Oracle AQ, created from a queue table with queue_payload_type of SYS.AQ$_JMS_MAP_MESSAGE. I can successfully enqueue a Map message using PL/SQL, but when I try to read a message from the queue using the JMS API (with the Oracle AQ JMS provider JARs) in a standalone Java program, the message is not successfully read. However, the RETRY_COUNT in the queue table is incremented each time I try to read from the queue. I do not receive any error messages on the client side.
    If I change the queue_payload_type of the queue table to SYS.AQ$_JMS_TEXT_MESSAGE instead and enqueue a text message using PL/SQL, I can read the text message successfully in the standalone Java program using JMS. The message is removed from the queue and everything works fine.
    Most Oracle AQ/JMS examples I've found on the web involve text messages. Has anyone been able to read a Map message from an Oracle AQ queue using JMS, or is there a known issue with Map messages?
    I'm running Oracle 10g Standard Edition version 10.2.0.1.0 on Windows XP.
    Thanks for your help,
    Marty

    While you are awaiting an answer you might want to consider applying the 10.2.0.4 patch. Your version is several years old and patches are free.

  • Why JMS if we can use JAVA classes for the same

    if we can communicate using the java classes which are protable and platform independent why do we have to use JMS for that. what is so specific about it and what is the benefit that makes it outstanding

    James/Steve,
    I feel that some of your points are misleading. The original authors point was a comparison against JMS and other means of achieving similar functionality with Java. Regarding your combined points:
    2) Scalability is something that can be achieved regardless of whether JMS is used. Clustering has nothing to do with JMS, each vendors clustering implementation is entirely proprietary.
    4) Aside from the inclusion of JNDI the JMS specification offers nothing for management. You only need to look through this forum at the amount of times a question like �how do I make a topic programmatically?� has been asked. All good JMS vendors offer management API�s and tools but all are vendor specific implementations.
    10) There is no JMS standard for load balancing. The generic round robin features of a JMS queue falls a long way short of true �load balancing�. Any vendor (ourselves included) that offers load balancing does so in an entirely proprietary manner.
    11) Again�JMS provides no standards for clustering of running one or more server. This is entirely down to implementation and functionality is vendor specific.
    12) Dead Message/Letter Queues are not defined in JMS
    14) What does serialization have to do with the original point? How one chooses to serialize their content ( XML, Object Serialization, Externalizable etc..) is equally applicable to both bespoke Java coding and JMS implementations.
    To birs1982:
    JMS is merely a collection of interfaces that define how one might read and write to a topic or queue. Vendors (both open source and commercial) recognize that these interfaces alone are not enough to offer an entire middleware messaging solution and complete the offering with sophisticated management, resilience, clustering, security and other value added features. These value added features require considerable effort to get right as do things like scalability and performance.
    Given JMS like messaging is almost commodity now (just look at the amount of JMS vendors that have leaped into the ESB space) and a common (perhaps essential) infrastructure component why produce it yourself? Surely your time is better spent serving your clients and business lines rather that writing what amounts to plumbing. All the hard work has been done and the price for this hard work (depending on your requirements) is anything from free to many thousands of pounds.
    Regards,
    Paul Brant
    my-Channels - Technologies working together
    http://www.my-channels.com/

  • JMS Message Headers

    Hi,
    I have a IDOC -> SAP PI -> JMS scenario. JMS service is an External Party.
    I have to populate the JMS message Header with Fields like JMSType, Sender and Receiver. These fields will come from the IDOC. How to populate these?
    <JMSType>Notification</JMSType>
    <Sender>SAPR3</Sender>
    <Receiver>JMSService</Receiver>
    If I am not wrong, I have to make use of Dynamic Configuration and populate, but if I look at the available JMS ASMA, I am not able to decide how (which fields to use) to populate. Earlier I had done Dynamic Configuration for FILE and SOAP adapters.
    Thank you,
    Pankaj.
    Edited by: Pankaj Sharma XI on Oct 4, 2010 2:38 PM

    Hi Raj and Amol,
    Thank you for responding.
    anyway you can try to use dynamic configuration UDF, it will work.
    Yes I will do it using UDF.
    Add AF_Modules/DynamicConfigurationBean and set the value of the above
    If I use DynamicConfigurationBean, then the value will be static, the one which I fill in the Communication Channel. So I have to make use of UDF.
    What I think is:
    1) Create a UDF in message mapping with below logic:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get
    (StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS","DCJMSMessageProperty0"); //also logic for Property1 and Property2.
    conf.put(key1,MessageType); //MessageType comes from IDOC.
    return "";  //no need to return a value.
    2) Create a Receiver JMS channel with below settings:
    Specify Additional JMS Message Properties
    Name - MsgType               Java Type - String
    Name - Sender               Java Type - String
    Name - Receiver               Java Type - String
    Now with the above settings I should (hopefully) get the headers like:
    <MsgType>AbcValidation</MsgType>
    <Sender>SAPR3</Sender>
    <Receiver>JMSReceiver</Receiver>
    I will try with the above configuration and update the thread accordingly. *If you feel that the approach is wrong/ incomplete, then
    please do respond.*
    Thank you,
    Pankaj.

  • Unable to send messag to JMS Queue using Java

    Hi all,
    I am trying to send a string to the JMS queue using java. I am unable to send the message. It is getting failed at the look up for connection factory. I am using the below code for this purpose.
    public static void messageEnqueue(String payload) throws JMSException,
    NamingException,
    IOException {
    Session session = null;
    MessageProducer publisher = null;
    TextMessage message = null;
    Context context = new InitialContext();
    QueueConnectionFactory connectionFactory =
    (QueueConnectionFactory)context.lookup("*java:comp/env/XAConnectionFactoryJNDIName*");
    Connection connection = connectionFactory.createConnection();
    Queue Queue1 =
    (Queue)context.lookup("*java:comp/env/QueueName*");
    session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
    publisher = session.createProducer(Queue1);
    message = session.createTextMessage(Payload);
    connection.start();
    publisher.send(message);
    connection.stop();
    connection.close();
    kindly help on this.
    Thanks
    Edited by: 887737 on Jun 28, 2012 9:47 PM

    887737 wrote:
    Hi EJP,
    This is the Exception I got when I ran the java class directly from Jdeveloper. Can't I run the standalone class directly from Jdeveloper to insert the message into remote queue?
    Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at javamail.MessageEnqueue.messageEnqueue(MessageEnqueue.java:30)
         at javamail.MessageEnqueue.main(MessageEnqueue.java:51)Hmm. The stack trace doesn't involve any JMS code. Is javamail.MessageEnqueue.messageEnqueue your application? It seems to be doing a JNDI lookup, and you haven't configured JNDI properly. Exactly how to do this depends on what JNDI provider you are using. Earlier in the thread you mentioned you were using WebLogic, so the answer may lie in the WebLogic documentation.
    Nigel

  • How to store and retrieve XML messages in AQ using ESB/ BPE

    Hello,
    I am having a requirement which I feel should be fairly common - store and retrieve XML messages in AQ. However, I am struggling to decide which type of queue to use AQ or JMS...Here is the requirement
    1. In an ESB, I want to read different kind of files using file adapter. Different kind as in, having different structure or schema
    2. I want to create a queue that is capable of storing any kind of xml data. To this queue, I want to enqueue the message read in step 1.
    3. In another process, say a BPEL, I want to dequeue the message and write into a file. The filename is retrieved from one of the header properties. I want to dequeue using a stored procedure, not by using a JMS or AQ Adapter (reason being that these adapters poll the queue, and consume a message immediately. However, I want to consume the message only when there is a business need)
    My questions are:
    1. What kind of queue I should create in the DB (What should be its payload type...XMLType? )... I guess the answer would also determine the adapter to be used - JMS or AQ
    2. How I should map the xml data read from the file in step 1 to this adapter
    Any help is highly appreciated.

    You are right in suggesting that I dont need to store my XML data as xml in the DB...I dont want to too :) but its just that, thats the only option I can see at this time (the other track i am exploring is :
    File adapter(XML) -&gt; Convert to opaque (base64binary) -&gt; Enqueue opaque to JMS (aq$_jms_bytes_message) -&gt;Dequeue Opaque -&gt; Write file opaquely.
    In this I have hit the roadblock in trying to convert XML to base64binary...maybe some custom java function is needed...anyway)
    Coming back to this thread, where I am trying the following
    File adapter(XML)  -&gt; Enqueue as XML to queue  -&gt;Dequeue XML -&gt; Write file opaquely.
    PS: I think its important for me to mention that I am using SOA 10.1.3.1.0
    I tried the steps you gave...after creating the queue, I am trying to create a JMS adapter. But the queue I created doesnt show up in the browse window of destinations for the JMS Adapter..That had led me to infer that JMS adapter cant be used
    {color:#99cc00}CREATE OR REPLACE TYPE batchupdate_row_type AS OBJECT
    (update_queue_id NUMBER
    ,upc VARCHAR2(20)
    ,price1 NUMBER);
    {color}
    {color:#99cc00}CREATE OR REPLACE TYPE batchupdate_rec_type AS VARRAY(9999999) OF batchupdate_row_type;
    CREATE OR REPLACE TYPE payload_type AS OBJECT ( payload batchupdate_rec_type);
    EXECUTE DBMS_AQADM.CREATE_QUEUE_TABLE ( queue_table =&gt; 'jmsuser.batch_update_queue_table', queue_payload_type =&gt; 'payload_type');
    EXECUTE DBMS_AQADM.CREATE_QUEUE ( queue_name =&gt; 'batch_update_queue', queue_table =&gt; 'jmsuser.batch_update_queue_table');
    EXECUTE DBMS_AQADM.START_QUEUE ( queue_name =&gt; 'batch_update_queue'); {color}
    I also needed some opinion on whether the last step of my proposed solution ( Dequeue XML -&gt; Write file opaquely) is possible. As I want to develop a service oblivious of the structure of the file, I dont want to create a file adapter based on a particular xsd...so I want to write whatever xml I am getting from the queue....is this step possible

  • JMS/AQ: Setting properties for JMS message using PL/SQL

    I have created a procedure in PL/SQL that uses JMS messages, and now I need to include a property so that the subscriber can use a message selector to filter out unwanted messages. Is this possible using PL/SQL?
    A previous post said: "... But you can have properties in the message payload itself and also define selectors on the message content ...". But I looked at Sun's tutorial and there it said: "A message selector cannot select messages on the basis of the content of the message body."
    I have 300 different screens and messages apply only to one screen at a time. When the user is looking at screen 'A' I want him to only recieve messages that apply to screen 'A'. I thought I would do this with message selector, but is there any other way?
    Here is my code(borrowed from an earlier post)
    PROCEDURE ENQUEUE_JMS_MESSAGE AS
    BEGIN
    DECLARE
    Enqueue_options DBMS_AQ.enqueue_options_t;
    Message_properties DBMS_AQ.message_properties_t;
    Message_handle RAW(16);
    User_prop_array SYS.AQ$_JMS_USERPROPARRAY;
    Agent SYS.AQ$_AGENT;
    Header SYS.AQ$_JMS_HEADER;
    Message SYS.AQ$_JMS_TEXT_MESSAGE;
    Message_text VARCHAR2(100);
    BEGIN
    Agent := SYS.AQ$_AGENT('',NULL,0);
    User_prop_array := SYS.AQ$_JMS_USERPROPARRAY();
    Header := SYS.AQ$_JMS_HEADER( Agent, '', 'aq1', '', '', '', User_prop_array);
    Message_text := 'Message 1 from PL/SQL';
    Message := SYS.AQ$_JMS_TEXT_MESSAGE(Header, LENGTH(Message_text), Message_text, NULL);
    DBMS_AQ.ENQUEUE(queue_name => 'tstopic',
    Enqueue_options => enqueue_options,
    Message_properties => message_properties,
    Payload => message,
    Msgid => message_handle);
    END;
    END;
    -Christer

    Thanks for the answer. I managed to set the Correlation id and retrieve it using getJMSCorrelationID(). But I did not manage to use the MessageSelector on it. I have used the Topicbrowser which is not part of the JMS standard? I tried to enqueue the messages using Java too and tried to use the topicbrowser on both JMSCorrelationID and user defined properties withou success. Is there some special requirements of the TopicBrowser?
    Enumeration messages;
    oracle.jms.TopicBrowser browser =tsess.createBrowser(topic, "TS", "JMSCorrelationID = 'TST'");
    int count = 0;
    messages = browser.getEnumeration();
    if(messages.hasMoreElements())
    System.out.println("message"); //never executed
    dtxtmsg = (TextMessage)(tsub1.receiveNoWait()) ; //returns a message
    String corrID = dtxtmsg.getJMSCorrelationID(); //returns: TST
    Thanks for your help so far...it would really save my day if you have some ideas on this too!
    -Christer

  • Client Id in use - WL6.1 sp3   server to server JMS messaging

    Any feedback would be greatly appreciated. THANKS!
              -Alan May
              Scenario:
              Two weblogic 6.1 sp3 instances running on two separate Solaris 8 boxes.
              Server a - a message producer(client) for a number of topics and queues on b
              Server b - hosts JMS services including all the topics and queues, has both
              message producers and mdb consumers for a number of topics and queues
              What I've set up: a durable connection factory for topics for server a,
              topics for server b, queues for server a, and queues for server b (all
              targeted to server b)
              I have a singleton on each server that has methods to retrieve the queue
              connection or topic connection appropriate for that server(a single
              connection is
              shared for all topic producers and a separate connection is share for all
              queue producers for each server)
              I have each producer open and close a new session every time. However, the
              topic and queue connections are shared for all producers for that JVM. This
              seemed to be the approach recommended by the JMS spec, but do you feel this
              is the appropriate granularity given the above scenario? I am not currently
              closing my jms connection as part of a weblogic shutdown class. Is that
              essential in that case? If the server crashes - are there any
              recommendations on how to handle(if closing the connection is the issue)?
              I've confirmed that my JMS clients running with server b are not using the
              connection factories setup for a's use.
              Issue:
              Everything works on server b as expected.
              Server a's connections seemed to be fouled. I was getting that the clientid
              was in use(stack trace included below) while trying to fetch the connection.
              I stopped server a, removed the fouled connection factories on server
              b(dedicated for server a's use), and created new connection factories for
              a's use. I stopped server b and deleted everything from the two JMSState
              and JMSStore tables, restarted a then b, and tried the test again. This
              time the singleton code could fetch the connection without receiving a
              JMSException, but I was getting an exception when I tried to open a session
              from the connection.
              If worst comes to worse, I can stick a stateless session bean on b, to act
              as a delegate producer on behalf of server a, but I'd like to avoid it if
              possible.
              Any recommendations? Please let me know if it would be helpful for me to
              clarify any points.
              Server a's original error:
              weblogic.jms.common.InvalidClientIDException: Client id, Parser.topicPrime,
              is in use
              Start server side stack trace:
              weblogic.jms.common.InvalidClientIDException: Client id, Parser.topicPrime,
              is in use
              at
              weblogic.jms.frontend.FEConnection.setClientId(FEConnection.java:918)
              at weblogic.jms.frontend.FEConnection.<init>(FEConnection.java:178)
              at
              weblogic.jms.frontend.FEConnectionFactory$1.run(FEConnectionFactory.java:319
              at weblogic.management.internal.Helper.doLocally(Helper.java:1656)
              at
              weblogic.jms.frontend.FEConnectionFactory.connectionCreate(FEConnectionFacto
              ry.java:316)
              at weblogic.jms.frontend.FEConnectionFactory_WLSkel.invoke(Unknown
              Source)
              at
              weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
              at
              weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
              :93)
              at
              weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
              at
              weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
              2)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              End server side stack trace
              

    Hi Alan,
              Lots of questions in one message! I'm going to
              try and answer them using the shotgun approach -- let
              me know if I miss.
              (1) It is good practice to close JMS resources when you are done
              with them, even if the destination host server crashes. The reason
              is that the connection resource may be hosted on a different
              WL server than the destination.
              (2) Creating a session/producer per message is heavy-weight
              in terms of CPU and network - if your app is performance
              sensitive is is better to cache these resources for re-use.
              See the JMS Performance Guide for details.
              (3) From your description I can't tell which two
              clients are conflicting. If what I'm writing here
              doesn't help, please try to narrow it down and repost.
              (4) Make sure that the connection factory does not have
              a "client-id" configured for it. Otherwise only one client
              can use the connection factory - instead have individual
              clients dynamically set their ids.
              (5) Note that client-ids are usually only useful for
              durable subscriber access, as other types of clients
              generally don't need exclusive connections, and therefore
              don't need client-ids.
              (6) The attached notes, which are for MDBs, may help you
              understand durable subscriptions and client-id's better in general.
              Tom
              Alan May wrote:
              > Any feedback would be greatly appreciated. THANKS!
              >
              > -Alan May
              >
              >
              > Scenario:
              >
              > Two weblogic 6.1 sp3 instances running on two separate Solaris 8 boxes.
              >
              > Server a - a message producer(client) for a number of topics and queues on b
              >
              > Server b - hosts JMS services including all the topics and queues, has both
              > message producers and mdb consumers for a number of topics and queues
              >
              > What I've set up: a durable connection factory for topics for server a,
              > topics for server b, queues for server a, and queues for server b (all
              > targeted to server b)
              >
              > I have a singleton on each server that has methods to retrieve the queue
              > connection or topic connection appropriate for that server(a single
              > connection is
              > shared for all topic producers and a separate connection is share for all
              > queue producers for each server)
              >
              > I have each producer open and close a new session every time. However, the
              > topic and queue connections are shared for all producers for that JVM. This
              > seemed to be the approach recommended by the JMS spec, but do you feel this
              > is the appropriate granularity given the above scenario? I am not currently
              > closing my jms connection as part of a weblogic shutdown class. Is that
              > essential in that case? If the server crashes - are there any
              > recommendations on how to handle(if closing the connection is the issue)?
              >
              > I've confirmed that my JMS clients running with server b are not using the
              > connection factories setup for a's use.
              >
              > Issue:
              > ------
              > Everything works on server b as expected.
              >
              > Server a's connections seemed to be fouled. I was getting that the clientid
              > was in use(stack trace included below) while trying to fetch the connection.
              >
              > I stopped server a, removed the fouled connection factories on server
              > b(dedicated for server a's use), and created new connection factories for
              > a's use. I stopped server b and deleted everything from the two JMSState
              > and JMSStore tables, restarted a then b, and tried the test again. This
              > time the singleton code could fetch the connection without receiving a
              > JMSException, but I was getting an exception when I tried to open a session
              > from the connection.
              >
              > If worst comes to worse, I can stick a stateless session bean on b, to act
              > as a delegate producer on behalf of server a, but I'd like to avoid it if
              > possible.
              >
              > Any recommendations? Please let me know if it would be helpful for me to
              > clarify any points.
              >
              >
              >
              > Server a's original error:
              > weblogic.jms.common.InvalidClientIDException: Client id, Parser.topicPrime,
              > is in use
              >
              > Start server side stack trace:
              > weblogic.jms.common.InvalidClientIDException: Client id, Parser.topicPrime,
              > is in use
              > at
              > weblogic.jms.frontend.FEConnection.setClientId(FEConnection.java:918)
              > at weblogic.jms.frontend.FEConnection.<init>(FEConnection.java:178)
              > at
              > weblogic.jms.frontend.FEConnectionFactory$1.run(FEConnectionFactory.java:319
              > )
              > at weblogic.management.internal.Helper.doLocally(Helper.java:1656)
              > at
              > weblogic.jms.frontend.FEConnectionFactory.connectionCreate(FEConnectionFacto
              > ry.java:316)
              > at weblogic.jms.frontend.FEConnectionFactory_WLSkel.invoke(Unknown
              > Source)
              > at
              > weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
              > at
              > weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
              > :93)
              > at
              > weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
              > at
              > weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
              > 2)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              > End server side stack trace
              >
              >
              A durable topic subscriber MDB uses its name to generate its client-id.
              Since JMS enforces uniqueness on this client-id, this means that if a durable
              subscriber MDB is deployed to multiple servers only one server will be able
              to connect. Some applications want a different behavior where
              each MDB pool on each server gets its own durable subscription.
              The MDB durable subscription id, which must be unique on its topic, comes from:
              1) <jms-client-id>MyClientID</jms-client-id>
              (the weblogic dtd)
              2) if (1) is not set then the client-id
              comes from the ejb name.
              The durable subscription is uniquely identified within a cluster by a
              combination of "connection-id" and "subscription-id". Only one active
              connection may use a particular "connection-id" within a WebLogic cluster.
              The connection id comes from:
              1) The "ClientId" attribute configured on the WebLogic connection factory.
              This defaults to null. Note that if the ClientId is set on a connection
              factory, only one connection created by the factory
              may be active at a time.
              2) If (1) is not set, then, as with the subscriber-id,
              the connection-id is derived from jms-client-id descriptor attribute:
              <jms-client-id>MyClientID</jms-client-id>
              (the weblogic dtd)
              3) If (1) and (2) are not set, then, as with the subscriber-id,
              the connection-id is derived from the ejb name.
              Work-around:
              A) Create a custom connection-factory for each server:
              1) configure "JNDIName" to the same value across all servers
              ("myMDBCF" in this example)
              2) configure "ClientId" to a unique value per server
              3) enable "UserTransactionsEnabled"
              4) enable "XAConnectionFactoryEnabled"
              5) set "AcknowledgePolicy" to "ACKNOWLEDGE_PREVIOUS"
              6) target the CF at a single WebLogic server
              (Number 5 is required for non-transactional topic MDBs)
              B) In the MDB's weblogic-ejb-jar.xml descriptor, set the MDB's connection
              factory to the JNDI name of the custom connection factories configured in
              (A). Optionally, also specify the subscriber-id via the jms-client-id
              attribute.
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>exampleBean</ejb-name>
              <message-driven-descriptor>
              <connection-factory-jndi-name>myMDBCF</connection-factory-jndi-name>
              <jms-client-id>myClientID</jms-client-id>
              </message-driven-descriptor>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              C) Target the application at the same servers that have the custom connection
              factories targeted at them.
              Notes/Limitations:
              1) If the MDB is moved from one server to another, the MDB's corresponding
              connection-factory must be moved with it.
              2) This work-around will not work if the destination is not in the same
              cluster as the MDB. (The MDB can not use the local connection factory, which
              contains the connection-id, as connection factories do not work unless they
              are in the same cluster as the destination.)
              3) This work-around will not work for non-WebLogic JMS topics.
              

  • Can not dequeue JMS message of type SYS.AQ$_JMS_TEXT_MESSAGE using DBMS_AQ

    I'm having a problem using DBMS_AQ package to dequeue a JMS message of type SYS.AQ$_JMS_TEXT_MESSAGE that was put on the queue using Java JMS API.
    Both JMS header and payload return empty but if I do "select user_data" from the queue table, I can see the message.
    Appreciate any helps or tips.
    Kim

    This has been asked a lot of times - I'm not sure how my initial searching missed all of the other questions/answers related to this topic.
    In our case, the solution was to:
    1) Leave the queue as a sys.aq$_jms_text_message type
    2) Construct a sys.xmltype object with our desired payload
    3) Do a getStringVal() on the xmltype object and use that string as the payload for our queue message
    - Nathan

  • Using Weblogic jms message id for unique id

    Hi All,
    We have a requirement to generate random unique id for each message processed by the application. We are planning to leverage weblogic jms message id for this purpose rather than building our own application logic for this purpose . Will there be any issue adopting this ? We think weblogic jms message id will be unique across the cluster as id is a hash of current timestamp + jms server name + wl server name + ?? .. is this correct ?
    TIA
    Atheek

    Hi Atheek,
    It depends on what are you planning to do with that id, as there are some gotchas on Weblogic's JMSMessageID generation.
    I guess the msg id could be considered statiscaly unique as Tom says, but the msg id will change during the livecycle of your message, surprise! (yea, the JMS spec allows the JMS server to modify the msg ids).
    So if you want to use that id to correlate messages id, or to group info related to one message, using JMSMessageID could be a problem.
    You can consider to generate a UUID, using Java 1.5 support (java.util.UUID) or a external library (JUG http://jug.safehaus.org for instance), and attach that id as a JMSCorrelationId or a user defined property.
    Hope this helps

  • Consuming messages using Java

    Hi,
    I am using BlazeDS running in Tomcat 6.0.16. The Flex client components are written using Flex 3. I have a messaging destination set up and the Flex producers and consumers are working fine. I am able to push messages from the server top the clients using the MessageBroker.routeMessageToService method.
    How can I read/consume messages using Java in the server? I haven't been able to find any documentation or examples on how to do this. Any help and advice is greatly appreciated ... Thanks!
    -- C

    <div class=Section1><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Alex:<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Thank you for your reply. I would prefer not to use JMS since in<br />order to receive messages asynchronously, I would have to use a J2EE message<br />driven bean.  I am trying to implement a listener that can run in Tomcat. <o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Is there a way of doing this without using JMS? Using the<br />message broker I can get a reference to the destination object. And from there<br />I presume it is a matter of registering a callback handler or such &#8230; but<br />I couldn&#8217;t find anything similar in the javadocs.<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Cheers,<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Chamara<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><br /><br /><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span<br />style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Alex Glosband<br />[mailto:[email protected]] <br><br /><b>Sent:</b> Thursday, March 13, 2008 9:04 AM<br><br /><b>To:</b> [email protected]<br><br /><b>Subject:</b> Re: Consuming messages using Java<o:p></o:p></span></p><br /><br /></div><br /><br /><p class=MsoNormal><o:p> </o:p></p><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>A new message was posted by<br />Alex Glosband in <br><br /><br><br /><b>General Discussion</b> --<br><br />  Consuming messages using Java<br><br /><br><br />The easiest way to do this is to use the JMS messaging adapter in BlazeDS. This<br />adapter lets your Flex clients publish messages to and receive messages from<br />JMS destinations. You can also have Java JMS clients that send messages to and<br />receive messages from these same destinations. <br><br /><br><br />Take a look at the &quot;Configuring the JMS adapter&quot; section of BlazeDs<br />dev guide for more information about this. <br><br /><br><br /><a<br />href="http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=messaging_ config_3.html#256378">http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?conte nt=messaging_config_3.html#256378</a><br /><br><br /><br><br />-Alex <o:p></o:p></p><br /><br /><div class=MsoNormal><br /><br /><hr size=2 width=200 style='width:150.0pt' align=left><br /><br /></div><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>View/reply at <a<br />href="http://www.adobeforums.com/webx?13@@.59b4a54c/0">Consuming messages using<br />Java</a><br><br />Replies by email are OK.<br><br />Use the <a<br />href="http://www.adobeforums.com/webx?280@@.59b4a54c!folder=.3c061a83">unsubscribe</a>< br />form to cancel your email subscription.<o:p></o:p></p><br /><br /></div>

  • Is it possible to retrieve Address Book from MS Exchange using Java IMAP

    My JSP is required to display all valid email address to end user.
    Is there any way i can retrieve Name & Email information (Address Book) from M.S Exchange server using Java implementation of IMAP protocal?
    I believe M.S Exchange server is IMAP compatible so i should'nt be required to do any configuration on mail server side ?
    If somebody has recently done this please share the implementation details , thanks,.
    Please also let me know how to attach duke dollars with this thread.

    No, because that Java implementation you refer to is completely oriented towards handling messages. The Exchange address book has nothing to do with that.

  • Retrieve jms message by jmsmesage id

    I need to retrieve a message from oracle Queue by the jmsId of the message from jdeveloper 10.1.2. I know the jmsId of the message. tried to use the message selector in java. it looks like the application hangs or never gets out of the loop.
    TopicSubscriber subscriber = topicSession.createDurableSubscriber(topic,"mysub","JMSMessageID = '" + myjmsId+ "'",true);
    Message msg = subscriber.receive();
    TextMessage textMsg = (TextMessage) msg;
    String messText = ((AQjmsTextMessage)textMsg).getText();
    Any help would be greatly appreciated.
    Thnaks
    MM

    you can't cast IFaultRecoveryContext into anything else, it's an Interface and it doesn't extend anything:
    public interface IFaultRecoveryContext
    public abstract String getIndex(int i);
    public abstract Map getProperties();
    public abstract String getActionId();
    public abstract String getPolicyId();
    public abstract String getActivityType();
    public abstract String getActivityId();
    public abstract String getActivityName();
    public abstract String getWsdlLocation();
    public abstract String getPartnerLinkName();
    public abstract QName getPortType();
    public abstract String getCorrelationId();
    public abstract BPELFault getFault();
    public abstract BPELProcessId getProcessId();
    public abstract String getStatus();
    public abstract void setStatus(String s);
    public abstract String setTitle(String s);
    public abstract String getTitle();
    public abstract int getPriority();
    public abstract void setPriority(int i);
    public abstract long getInstanceId();
    public abstract Locator getLocator();
    public abstract void addAuditTrailEntry(String s, Object obj);
    public abstract void addAuditTrailEntry(String s);
    public abstract void addAuditTrailEntry(Throwable throwable);
    public abstract Object getVariableData(String s)
    throws BPELFault;
    public abstract Object getVariableData(String s, String s1)
    throws BPELFault;
    public abstract Object getVariableData(String s, String s1, String s2)
    throws BPELFault;
    public abstract void setVariableData(String s, Object obj)
    throws BPELFault;
    public abstract void setVariableData(String s, String s1, Object obj)
    throws BPELFault;
    public abstract void setVariableData(String s, String s1, String s2, Object obj)
    throws BPELFault;
    }

  • PeerGoneException sending large JMS messages using T3.

    Hello,
              I'm using WL 7.0 SP4 on the backend. I have clients that send JMS messages to this WL server using T3. Some of the messages are ~1MB in size, and sometimes the clients use dial-up connections with a maximum speed of 54 Kbps. (Yes, I know we are living in the dark ages...)
              Anyway, sometimes the WL server throws a PeerGoneException. I realize this is because the CompleteT3MessageTimeout has expired. I have already set it to the maximum of 480 seconds, but sometimes that's not enough. Is there a way to disable this timeout or set it to be infinite?
              Does anyone have any suggestions?
              thanks in advance,
              matt

    sorry for answering myself...
              if you set 480 seconds on client and on server side, you will get a time
              range of 480 seconds.
              you will never be able to get more then 480 seconds. (And yes, there
              only existe the T3MessageTimout, which should be fine to my point of view.
              Another point might be the jta transaction timeout server-side.
              Regards
              Klaas
              Klaas Hagemann schrieb:
              > Hi Matt,
              >
              >
              > the settings have to be the same, client- and serverside. The whole t3
              > connection times out.
              > I only tested it with 8.1, so i cannot give you any advice concerning 7.0.
              > Maybe you should contact BEA Support, they should easily be able to
              > check whether there exists a patch for 7.0
              >
              >
              > Sorry...
              >
              >
              > Klaas
              >
              >
              > Matt Hill schrieb:
              >
              >>Thanks for the reply, Klaus.
              >>
              >>We are using WL 7.0 (not 8.1), so we do not have the CompleteMessageTimeout attribute. WL 7.0 only has the CompleteT3MessageTimeout attribute, which I set to the maximum of 480 secs, but unfortunately it sometimes takes longer to transfer our messages.
              >>
              >>I tried your suggestion of setting the client-side java property, but it did not help. I believe my problem is that the server times out - not the client.
              >>
              >>Any other ideas would be greatly appreciated.
              >>
              >>thanks,
              >>matt

  • How to delete message from the fodler of  AOL account using Java mail

    Hello All,
    I am using Java MAil API in my application, i want to delete message from AOL account's folder,
    when i set the folder as "Recently Deleted" or "Trash" , i get an exception as "folder does not exist".
    when i tested , some times mail is moving into Recently Deleted folder, but not every time.
    this is happening in both the interface as AOl Interface or my application.
    when i use folder.close(true) after setting the flag of message as DELETED. it completely remove the message from the acount.
    but i want to let the message be remained in the Recently Deleted folder. what should i do.
    i dont want to remove the message completely from the account.I am using IMAP also.

    You'll need to figure out what the real name of the "Recently Deleted" folder is on the AOL IMAP server
    (assuming it's a real folder and not some sort of "virtual" folder), then copy the message into that folder.
    See the folderlist.java demo program as a way to explore the names of all the folders on the server.

Maybe you are looking for

  • How to create variable record length target file in SAP BODS

    Hi All I have a requirement to create target file which will have various record layout; meaning different record length (similar to cobol file format), but this is for the target. Please let me know what is the best practice and how to solution this

  • Electronic signature in merged documents?

    I am trying to create a new document using multiple files. Some of these files contain electronic signatures. Can the electronic signatures be preserved in the merged document?

  • Backlight doesn't work on v 1.1

    Hello there How I can temporarily turn on v 1.1 backlight, while it is set off. Because on v 1.0 it was possible to turn on/off by holding MENU for app. 2 sec. But in v 1.1 I can't do this. Am I doing something wrong or it is disabled? Thanks for any

  • Gnome 3 Activity Bar

    I have just upgraded from gnome2 to gnome3 as per the wiki states and I have been left with a slightly odd gnome3 install. I have a few graphical glitches which I cannot pinpoint the reasons for. The screenshots below illustrate the various problems:

  • What type of extension would this be?

    Hi. I'm building an extension that will allow the user to insert an HTML5 video tag on the page along with a JavaScript script tag pointing to a library file. Here's what the user needs to be able to do: See a dialog box that allows the setting of an