Information Technology Reference
In-Depth Information
JMS interface
Another way of accessing the KIE Workbench runtime engines is through the JMS imple-
mentations. It uses a set of queues to send serialized versions of the command objects for
task service and KIE session method executions. These commands, whether they are sent
to the task service or the KIE session, are sent through two different queues: jms/queue/
KIE.TASK or jms/queue/KIE.SESSION queues, respectively. Responses are handled
through the jms/queue/KIE.RESPONSE queue.
These are the default configurations in the KIE Workbench application, but they can be
changed in the bpms-jms.xml file under the WEB-INF/ folder of the KIE Workbench.
There is another queue we haven't mentioned because, for the moment, it is not managed
by the RemoteRuntimeEngine interface. This queue is the audit queue. It manages re-
quests for the AuditLogService interface, to access the history logs from outside ap-
plications.
In order to create code that could manage messages for the first three queues in a standard
way, we must create the runtime engine through the provided API, as shown in the follow-
ing code snippet:
InitialContext ctx = new InitialContext();
QueueConnectionFactory connFactory =
(QueueConnectionFactory)
ctx.lookup("jms/RemoteConnectionFactory");
Connection conn = connFactory.createConnection(
"mariano", "mypass");
Session session = conn.createSession(true,
Session.AUTO_ACKNOWLEDGE);
Queue ksQueue = (Queue) ctx.lookup("jms/queue/KIE.SESSION");
Queue taskQueue = (Queue) ctx.lookup("jms/queue/KIE.TASK");
Queue respQueue = (Queue) ctx.lookup("jms/queue/
KIE.RESPONSE");
RuntimeEngine engine =
RemoteJmsRuntimeEngineFactoryBuilderImpl.
newBuilder().addDeploymentId("org.jbpm:HR:1.0").
addConnectionFactory(connFactory).addKieSessionQueue(ksQueue).
Search WWH ::




Custom Search