cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver based date transformation

Former Member
0 Kudos

Hi,

We have a scenario where we need to map the date to the receiving databases. We have the same map going to oracle receiver and a mySQL receiver. The date formats of both the databases are different. How can this be handled within the same map ( like receiver based date transformation) or does it need to go throught the traditional route of different maps for different JDBC receivers? Any help is appreciated..

Teresa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Does your source payload has data for both database at the same time?

If one source message is having data for only one DB at a time, then in message mapping you can handle based on condition.

However if your source payload can have data for both DB at the same time, then you will have to create separate mapping programs.

-Gouri

Former Member
0 Kudos

Yes, I have the same payload going across to both DB at the same time. THe payload to mySQL is failing because the date format is in oracle transformation. I was wondering whether this could be done without doing 2 different maps.

Teresa

Former Member
0 Kudos

Teresa,

Yes, I have the same payload going across to both DB at the same time. THe payload to mySQL is failing because the date format is in oracle transformation. I was wondering whether this could be done without doing 2 different maps.

Yes, you can do it in the same mapping.

For two different receivers, you must be having two different Business Services? If yes, then get the values of receiver BS in your mapping and do a simple condition test. Apply the date transformation logic accordingly.

For getting the Receiver Service name, you can either use the "Receiver" under "Constant" standard function or use the following UDF -

String RcvService;

java.util.Map map;

map = container.getTransformationParameters();

RcvService = (String) map.get(StreamTransformationConstants.RECEIVER_SERVICE);

return RcvService;

You can change the above code as per your requirement.

Hope this helps.

Regards,

Neetesh

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Smith,

Your Scenario Looks like this

Source---->PI---->2 Rreceivers(MYSQL and ORACLE).

Use enhanced receiver determination to check the condition like date format in source message,based on condition you can route the message to receiver.this is the traditional approch.

With the same map if you want to achieve?? even in this case also you need to create two receiver communication channels because the data bases are different and connection parameters and drivers details are different,its not possible to change the data base connection details dynamically.So my advice follow tradition approch.

But we have some other option to achive the same using one JAVA Mapping/UDF,We can perfrom Data base operation in JAVA Mapping,but its not adviceble,but we can achive this requirement like check the cndition in Java mapping based on Date format,based on condition perform insert data in data beses.if you want change date format you can.But the disadvantage its not advisable to make data base connection from data base.

Regards,

Raj