Testing the Sybase CEP JMS Adapter

Provides directions on testing the Sybase CEP JMS Adapter.

Make sure that you have all of the required .jar files:
  • c8-jms-adapters.jar

  • c8-sdk-java.jar

  • jaxrpc.jar

  • jms.jar

  • axis.jar

  • commons-logging-1.0.4.jar

  • commons-discovery-0.2.jar

  • saaj.jar

  • wsdl4j-1.5.1.jar

  • activation.jar

  • mail.jar

  • castor-0.9.9.jar

  • xercesImpl.jar

You typically need one or more .jar files provided with your JMS server. For example, if you are using the BEA WebLogic JMS server, then you will need weblogic.jar, which is supplied by BEA.

The location of the .jar file for your JMS server depends on the web server you are using. For example, weblogic.jar is found in your BEA\weblogic81\server\lib directory.

Although most of the required .jar files already reside in C:\Program Files\SybaseC8\Server\sdk\java5\lib, a few are not found there. The exceptions are

c8-jms-adapters.jar and c8-sdk-java.jar, which are found in the SybaseC8\Server\sdk\java directory.

Make sure that all the required processes are up and running:

  1. Make sure that your JMS server is running.
  2. Make sure that the Sybase CEP Server is started. To start the server, go to Start -> All Programs->Sybase CEP ->Server->Sybase CEP Server
  3. Make sure that your CCL Module is running. Do this by starting the Sybase CEP Studio and then running your CCL module from within Sybase CEP.
  4. Start the JMSAdapter, so that messages from Sybase CEP get sent to the desired JMS Server topic destination.
  5. Set your CLASSPATH so that it includes all the necessary jar files.
  6. Give the command to start the JMSAdapter. The command below is appropriate for the WebLogic JMS server. If you are using a different server, you will have to change some items, including the boldfaced items and probably the port. The following is a single command; we have spread it across multiple lines to make it easier to read.
    java  -Dc8.baseHostPort=localhost:6789 
    		com/sybasec8/adapter/JMSAdapter   
    		--messageType=TextMessage 
    		--topic=
    weblogic.jws.jms.MyJMSTopic
      
    		--factoryName=
    weblogic.jws.jms.TopicConnectionFactory
      
    		--initialNamingFactory=
    weblogic.jndi.WLInitialContextFactory
      
    		--url=ccl://localhost:6789/Stream/Default/TestJMS/instream1 
    		--host=localhost 
    		--port=7001
    

    Explanation of the adapter properties:

    The environment variable c8.baseHostPort controls where to establish the connection to the server. This can be set by the -D option on the command line.

    The value given for --topic (weblogic.jws.jms.MyJMSTopic)is the JNDI Name for the topic destination you want to send the c8 messages to.

    The value given for --factoryName (weblogic.jws.jms.TopicConnectionFactory) is the JNDI name for the Connection Factory you created, which targets the WebLogic Server where your JMS Server is deployed.

    The value given for --initialNamingFactory (weblogic.jndi.WLInitialContextFactory) is the name of the factory class to use to make the connection.

    The value given for --URL (ccl://localhost:6789/Stream/Default/TestJMS/instream1) is the URL of the Sybase CEP stream you want to subscribe to. The value of the URL can be obtained from Studio, by clicking on the stream in the Explorer View and then clicking on the Properties View.

    Make sure that you set the host and port to be the host and port of the JMS server, not the Sybase CEP Server. The host and port for the Sybase CEP Server are specified as part of the c8.baseHostPort.

  7. If the JMSAdapter started successfully, you should see the following output:
    Connecting to CPX server...
    	Opening a subscription...
    	Listening for messages...
    
  8. Check to make sure that the messages arrive at the topic destination. The method for doing this depends upon the JMS Server you are using.