Oct 22

Java CAPS solutions can selectively retrieve messages from JMS Destinations using static selector expressions, configured in Connectivity Maps. This configuration is performed at design time and is static – to change a selector value requires that the solution is re-built and redeployed.

This extract, from the “Java CAPS Basics …” book, discusses and illustrates dynamic use of JMS Selectors in Java Collaboration definitions.

This extract, from the “Java CAPS Basics …” book, discusses and illustrates the use of dynamic JMS Selectors to implement a correlation mechanism without the use of eInsight correlations.

4 Responses to “Java CAPS 5.1.3 Dynamic JMS Selectors”

  1. Shweta says:

    I am trying to code the same functionality of dynamically setting the message selector inside the JCD in JCAPS 63

    I have used the same logic mentioned in your book extract

    However, I am getting error while executing this part of the code.

    Queue myQueue = (Queue) jndiContext.lookup( “queues/” + cRECEIVE_FROM );

    The error :

    javax.naming.NamingException: Failed to obtain list of destinations: javax.jms.JMSException: Unrecognized message type received; possible protocol version mismatch [Root exception is javax.jms.JMSException: Unrecognized message type received; possible protocol version mismatch]|#]

    at com.stc.jms.jndispi.Destinations.assureDestinationsAreLoaded(Destinations.java:216)|#]
    at com.stc.jms.jndispi.Destinations.getDestinations(Destinations.java:294)|#]
    at com.stc.jms.jndispi.DestinationsContext.getContents(DestinationsContext.java:51)|#]
    at com.stc.jms.jndispi.BaseContext.find(BaseContext.java:83)|#]
    at com.stc.jms.jndispi.DestinationsContext.find(DestinationsContext.java:66)|#]
    at com.stc.jms.jndispi.BaseContext.find(BaseContext.java:113)|#]

    I have tried different values to see if it worked. One of the different values I tried are

    Queue myQueue = (Queue) jndiContext.lookup( “jms/” + cRECEIVE_FROM );
    ( In this the exception I got was name value pair not found). When I went to Glass fish and tried to JNDI browsing, I could see jms tree but not my Queue.
    1> Do I need to define my Queue in the Glass fish?

    Also, I have tried to change the following code

    static final String cPROVIDER_URL
    = “stcms://” + cJMS_HOST + “:” + cJMS_PORT;


    static final String cPROVIDER_URL
    = “mq://” + cJMS_HOST + “:” + cJMS_PORT;

    Could you throw some ideas for me to debug?

    • Hello, Shweta.

      The book example relates to Java CAPS 5.1.3 and stcms, as you are aware.
      There have been changes to the product since then, so that what low-level technical solution worked in 5.1.3 may no longer work in 6.3.
      You are not saying what JMS implementation you are using – stcms or Java Message Queue or, indeed, Oracle JMS. A solution will vary depending on which it is.
      I have been out of the Java CAPS business for more than 2 years and have not been following the technical topics relating to the product. I don’t have the Java CAPS 6.3 environment and have no means of working out what needs to be done to accomplish what you need to accomplish.
      I would suggest that logging a service incident with Oracle Java CAPS support might be the best approach for you at this point.

      All the best


  2. Shweta says:

    Hi Michael

    Thanks for the response

    I was able to resolve it, thanks for your help, there was issue on JNDI side configuration

    Thanks again

Leave a Reply

preload preload preload