Forum Stats

  • 3,722,440 Users
  • 2,244,312 Discussions
  • 7,849,837 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

EWPS and JMS

enterpriseprintsupport@allianzlife.com
[email protected] Member Posts: 50 Blue Ribbon
edited February 2 in Java Message Service (JMS)

We are running Documaker Standard Edition in a Docker container. We are using EWPS (in the same container) to receive requests and send them to Docupresentment to generate documents.

Currently, we are using http queues, but Oracle is recommending the use of JMS or MQ for high volume environments. I have Docupresentment listening on JMS queues (ActiveMQ is also installed in the container ..I can prove this by using thread.sh), but I am having trouble getting EWPS to communicate over JMS.

ewps.config.xml:

      <entry name="queuefactory.class">com.docucorp.messaging.jms.DSIJMSJNDIMessageQueueFactory</entry>

      <entry name="jms.inputqueue.connectstring">resultq</entry>

      <entry name="jms.outputqueue.connectstring">requestq</entry>

      <entry name="jms.qcf.name">queueConnectionFactory</entry>

      <entry name="jms.initial.context.factory">org.apache.activemq.jndi.ActiveMQInitialContextFactory</entry>

      <entry name="jms.provider.URL">tcp://0.0.0.0:61616</entry>

      <entry name="jms.security.principal">admin</entry>

      <entry name="jms.security.credentials">admin</entry>

      <entry name="jms.inputqueue.connectstring">resultq</entry>

      <entry name="jms.outputqueue.connectstring">requestq</entry>

Given that, the EWP log indicates:

2021-02-02 04:33:07,983-[http-nio-8080-exec-1]-Queue Manager properties -

#Tue Feb 02 04:33:07 UTC 2021

jms.qcf.name=queueConnectionFactory

jms.initial.context.factory=org.apache.activemq.jndi.ActiveMQInitialContextFactory

queuefactory.class=com.docucorp.messaging.jms.DSIJMSJNDIMessageQueueFactory

jms.outputqueue.connectstring=requestq

jms.inputqueue.connectstring=resultq

2021-02-02 04:33:07,984-[http-nio-8080-exec-1]-EWPS Configuration read from web.xml location '/WEB-INF/xml/ewps.config.xml'

2021-02-02 04:33:07,986-[http-nio-8080-exec-1]-EWPSDocumentServicesSkeleton : filecache is disabled

2021-02-02 04:33:08,443-[http-nio-8080-exec-1]-javax.naming.NameNotFoundException: queueConnectionFactory

I am missing something, and I suspect that I need to create a jndi.properties file so that EWP can find queueConnectionFactory.


Any ideas?

Thanks in advance!

Dave

Answers

  • AndyL-Oracle
    AndyL-Oracle Member Posts: 535 Employee

    Hi Dave,

    I haven't tested this specifically with EWPS, but I did do a similar setup with IDS using RabbitMQ over JMS. In order to do this, I used the following settings in docserv.xml, which should be translatable to your EWPS.config.xml:

    <section name="queue">
      <section name="marshallers">
      <entry name="marshaller.class">com.docucorp.messaging.data.marshaller.SOAPMIMEDSIMessageMarshaller</entry>
      <entry name="marshaller.class">com.docucorp.messaging.data.marshaller.SerializationDSIMessageMarshaller</entry>
      </section>
      <entry name="queuefactory.class">com.docucorp.messaging.jms.DSIJMSJNDIMessageQueueFactory</entry>
      <entry name="jms.initial.context.factory">com.sun.jndi.fscontext.RefFSContextFactory</entry>
      <entry name="jms.provider.URL">file:///home/oracle/odee/docupresentment</entry>
      <entry name="jms.qcf.name">idsqcf</entry>
      <entry name="jms.inputqueue.connectstring">idsreq</entry>
      <entry name="jms.outputqueue.connectstring">idsres</entry>
    </section>
    

    Then, I created a .bindings file in the IDS directory - the RefFSContextFactory is automatically configured to look for this file in this directory; you may be able to do similar configuration for EWPS. Note you should replace the RabbitMQ class names with what's appropriate for your system.

    idsqcf/ClassName=javax.jms.ConnectionFactory
    idsqcf/FactoryName=com.rabbitmq.jms.admin.RMQObjectFactory
    idsqcf/RefAddr/0/Content=jms/ConnectionFactory
    idsqcf/RefAddr/0/Type=name
    idsqcf/RefAddr/0/Encoding=String
    idsqcf/RefAddr/1/Content=javax.jms.ConnectionFactory
    idsqcf/RefAddr/1/Type=type
    idsqcf/RefAddr/1/Encoding=String
    idsqcf/RefAddr/2/Content=com.rabbitmq.jms.admin.RMQObjectFactory
    idsqcf/RefAddr/2/Type=factory
    idsqcf/RefAddr/2/Encoding=String
    # replace with IP address of RabbitMQ host.
    idsqcf/RefAddr/3/Content=127.0.0.1
    idsqcf/RefAddr/3/Type=host
    idsqcf/RefAddr/3/Encoding=String
    idsreq/ClassName=javax.jms.Queue
    idsreq/FactoryName=com.rabbitmq.jms.admin.RMQObjectFactory
    idsreq/RefAddr/0/Content=jms/Queue
    idsreq/RefAddr/0/Type=name
    idsreq/RefAddr/0/Encoding=String
    idsreq/RefAddr/1/Content=javax.jms.Queue
    idsreq/RefAddr/1/Type=type
    idsreq/RefAddr/1/Encoding=String
    idsreq/RefAddr/2/Content=com.rabbitmq.jms.admin.RMQObjectFactory
    idsreq/RefAddr/2/Type=factory
    idsreq/RefAddr/2/Encoding=String
    # replace [IDSREQ] with RMQ name for request queue.
    idsreq/RefAddr/3/Content=IDSREQ
    idsreq/RefAddr/3/Type=destinationName
    idsreq/RefAddr/3/Encoding=String
    idsres/ClassName=javax.jms.Queue
    idsres/FactoryName=com.rabbitmq.jms.admin.RMQObjectFactory
    idsres/RefAddr/0/Content=jms/Queue
    idsres/RefAddr/0/Type=name
    idsres/RefAddr/0/Encoding=String
    idsres/RefAddr/1/Content=javax.jms.Queue
    idsres/RefAddr/1/Type=type
    idsres/RefAddr/1/Encoding=String
    idsres/RefAddr/2/Content=com.rabbitmq.jms.admin.RMQObjectFactory
    idsres/RefAddr/2/Type=factory
    idsres/RefAddr/2/Encoding=String
    # replace [IDSRES] with RMQ name for result queue.
    idsres/RefAddr/3/Content=IDSRES
    idsres/RefAddr/3/Type=destinationName
    idsres/RefAddr/3/Encoding=String
    

    I might be able to come back later and test with with EWPS, but I thought I'd get this here to help you out a bit.

    -A

  • AndyL-Oracle
    AndyL-Oracle Member Posts: 535 Employee
    edited February 8

    Ok, I was able to get this working.

    Modify ewps.config.xml as shown below:

    <queuemanager>
            <entry name="queuefactory.class">com.docucorp.messaging.jms.DSIJMSJNDIMessageQueueFactory</entry>
            <entry name="ReceiveRequestIntervalMillis">30000</entry>
            <entry name="jms.initial.context.factory">weblogic.jndi.WLInitialContextFactory</entry>
            <entry name="jms.provider.URL">URL_TO_JMS_SERVER</entry>
            <entry name="jms.security.principal">JMS_USER</entry>
            <entry name="jms.security.credentials">JMS_PASS</entry>
            <entry name="jms.qcf.name">JNDI_QUEUE_CONNECTION_FACTORY_NAME</entry>
            <entry name="jms.inputqueue.connectstring">JNDI_RESULT_QUEUE_NAME</entry>
            <entry name="jms.outputqueue.connectstring">JNDI_REQUEST_QUEUE_NAME</entry>
            <entry name="jms.outputqueue.expiry">6000</entry>
    </queuemanager>
    

    Comment out/remove any other settings from the block.

    Replace the items in all caps with the necessary settings for your system. The items prefixed with JNDI_ will be resolved through a JNDI context lookup, which is done via the class named in the jms.initial.context.factory. In the above example, I'm using the WebLogic context factory to connect to a JMS server hosted in WebLogic. You will use the context factory appropriate for your JMS implementation. You may also use a context file, which is noted in my first comment above (create a .bindings file and set the jms.initial.context.factory to com.sun.jndi.fscontext.RefFSContextFactory).

    Copy the content of the <queuemanager> block into the the <IDSProvider> block, then save the file.

    Finally, make sure you place the appropriate JAR file that contains the jms.initial.context.factory class into the IDS lib directory.

Sign In or Register to comment.