ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Brohl <michael.br...@ecomify.de>
Subject Re: Setting Ofbiz with Enterprise Service Bus
Date Wed, 04 Feb 2015 11:39:38 GMT
Hi Jean-Luc,

I will try to give you a brief overview about our OFBiz/ESB integrations.

We have different interfaces to/from OFBiz, depending on the steps which 
are needed to process the data between OFBiz and other systems.

We have interfaces through REST, FTP to the outside world with different 
data formats (XML, CSV, EDI). These formats are transformed to a main 
"house format" and transported to OFBiz.

The REST endpoints are provided by the ESB (camel-jetty), not OFBiz 
directly. This is to decouple the systems in case the server setting 
will be more decentralized in the future.

For the REST endpoints we mainly have two "paths":
- directing the request directly to OFBiz with url rewriting in Apache 
(for data which comes in the "house format" and need no processing 
(request -> camel-jetty -> Apache -> OFBiz)
- directing the request and the data to an ActiveMQ endpoint for further 
processing (request -> camel-jms -> [different processing steps, 
enrichment, transformations etc.] -> camel-jms -> OFBiz)

For the FTP endpoints we have one main path (file -> camel-file -> 
camel-jms -> [different processing steps, enrichment, transformations 
etc.] -> camel-jms -> OFBiz)

The data path from OFBiz to other systems is through JMS (OFBiz 
jms-service -> camel-jms -> [further processing] -> [several endpoints]

The main paths contain several content based routers and different 
processors to enhance the data. I think this would blow this overview a 
little bit.

So OFBiz ist addressed in two ways: through normal https requests and 
through JMS. https should be clear.

For JMS, OFBiz already has a mechanism for sending and receiving JMS 
messages, used for the distributed cache clear.

Calling a service through JMS ist configured in the serviceengine.xml. 
The JMS message contains a service context map which is sent in the 
message body:

<!-- Config of output channel to send service calls via JMS -->
<jms-service name="outputChannel" send-mode="all">
    <server jndi-server-name="default" jndi-name="ConnectionFactory" 
topic-queue="ofbizServiceOutbound" type="queue" username="xxx" 
password="xxx" listen="false"/>
</jms-service>

The service to call another service through JMS (or just send some data 
to a queue) is configured as follows:

<!-- services.xml -->
<!-- Dummy service to demonstrate the way to call a service of the ESB 
component by sending a JMS message formed by this service definition -->
<service name="dummyCallEaiService" engine="jms" 
location="outputChannel" invoke="dummyService"> <description>Send a JMS 
message to an EAI queue to call an ESB service</description>
    <attribute name="parameter" type="String" mode="IN" optional="false" 
allow-html="any" /> </service>

The main elements are:

engine="jms":
defines the JMS service engine to call a service, a JMS message is 
generated instead of calling an OFBiz service
location="outputChannel":
specifies the queue to send the message to (configured above)
invoke="dummyService":
that's the name of the remote service to call (if any) or just some 
identifier for the message content to decide where to route the message 
or how to transform it

The way to call an OFBiz service through JMS is as follows

<!-- JMS Service Queue/Topic Configuration -->
<!-- Config of input channel to receive service calls via JMS -->
<jms-service name="inputChannel" send-mode="none">
    <server jndi-server-name="default" jndi-name="ConnectionFactory" 
topic-queue="ofbizServiceInbound" type="queue" username="xxx" 
password="xxx" listen="true"/>
</jms-service>

This is the configuration for the JMS provider at the ESB side.

The other JMS configurations take place in the jndi.properties

java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory 
java.naming.provider.url=tcp://127.0.0.1:61616
# register some queues in JNDI using the form
# queue.[jndiName] = [physicalName]
queue.ofbizServiceInbound = ofbizServiceInbound
queue.ofbizServiceOutbound = ofbizServiceOutbound

Now OFBiz listens to the configured queues.

To call an OFBiz service through JMS, we simply put a service context 
map in the body of the message and send it to the queue. We have a camel 
processor which takes the original data and wraps it in the service 
context map, specifying the OFBiz target service to call. No decision 
logic necessary at the OFBiz side.

Hope that helps to get things running on your side.

Regards,

Michael
ecomify.de

>> Good morning Michael
>> This is Jean-Luc you have answered in the ofbiz forum.
>> I am trying to to precisely what you have mentioned but I am using 
>> jboss Fuse esb and ServiceWorks.
>> But I can not find any any doc in this area.
>> Is it possible that you help me with some documents ? some small 
>> example of:
>>  REST endpoints and JMS/ActiveMQ to connect OFBiz to the ESB. For JMS 
>> we have modified the JMS/Service functionality in OFBiz.
>> I will be very grateful so I can start.
>>
>> kind regards
>> Dr Jean-Luc


Mime
View raw message