1 Introduction
This integration aims to send unstructured data(any format) to specified structured target and send it to target using service gateway pattern.
2 What is Service GateWay:
A service gateway acts as a proxy to a different services by providing a single entry point for incoming requests. All service requesters interact with single endpoint address.
The gateway is responsible for performing common operation on every message and routing the request to the correct service provider.
The gateway is used primarily as an intermediary between a service requestor and a service provider. To make any service provider available to service requestors, a gateway administrator creates a gateway service.
Administrators can expose gateway services on one or more gateway channels, each representing a particular data format and protocol used to access the gateway service
3 Service Gateway Patterns
Dynamic Service Gateway (body agnostic) is a Gateway pattern that only modifies the message header information, in this the endpoint address is determined at runtime.
Static Service Gateway (body aware) is a Gateway pattern that modifies the information contained in the body and the header of a message. In a static service gateway, the endpoint address is known when the message enters the gateway.Static Service GateWay : WebSphere Integration Developer provides a pattern that is a fast path to generate a service gateway, along with all the required artifacts. In a static service gateway, the endpoint address of the service provider is known before the message enters the gateway. The mediation flow typically modifies the information contained in the body and header of a message.
4 Creation of Webservice :
Static Service Gateway Creation For MQ
Step 1 : Create Service Gateway new --> project --> serviceGateway
Step 2: Provide Gateway Name
Step 3 : Select Static for Static Service Gateway
Step 4: Add Target Interfaces that is service providers.
Step 5 : Select Transport Protocol here we used MQ
Step 6: It generates a service gateway Skeleton
5 Target BO Structure
1 Customer BO
7 Inteface Structure
1 Customer Interface : IF_CustomerData
2 Item Interface : IF_ ItemDetails
8 Extracting Correlation ID:
byte[] correlId =
smo.getDataObject("headers").getDataObject("MQHeader").getDataObject("md").getBytes("CorrelId");
String targettype = new String(correlId);
targettype = targettype.trim().toUpperCase();
Route the data using this target type.
1 Data Handler Configuration For XMLSending unstructured data from queue and mq export takes the message as JMSTextBody.
<JMSTextBody><value>input message</value></JMSTextBody>
We are sending this value content to the data handler.
- To test this flow we need to test it we are able to give fixed-width data and xml data.
- Target Type is Customer for XML data, Item for fixed width data
- Put test message file in source MQ and provide correlation id as “xml”.
- Based on correlation id it will route to xml data Handler to serialize the input as xml data and place it into the target queue.
xmlinput:
- Put test message file in source MQ and provide correlation id as “fw”.
Input:
- Based on correlation id it will route to fixed width data Handler and it converted input data to specified target BO and place it into thetarget queue
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.