cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Adapter module in File Adapter

former_member854360
Active Contributor
0 Kudos

Hi,

I had developed one custom Adapter module to convert Some flat file to XML. I configured the module in receiver file adapter and triggred one Text message

from RWB and module works fine without any issue.

But when i am using the same module in sender adapter and trying to pick one file from NFS location and then convert then always the content is getting filled with empty payload. There was no error in the module.

Please help me to understand the issue. Why the same module works when file triggred from RWB but not with sender NFS location

Accepted Solutions (0)

Answers (1)

Answers (1)

nabendu_sen
Active Contributor
0 Kudos

HI Debashish,

You are using Integration Engine - Test Message option in RWB. Here message is directly posted to Integration Engine, bypassing Adapter. That's why you are getting success from RWB, but not from NFS.

former_member854360
Active Contributor
0 Kudos

Hi Nabendu,

Thanks for your Input. I will try to explain it again.

1) Case 1: While triggering the Message from RWB i have configured the Module in Receiveer file adapter. So module is getting executed in receiver adapter.Here it works fine

2) In Case 2:  But same module i had configured in Sender Adapter and tried to pick up the same file from NFS which i triggred in Case 1 from RWB. Here its not working

nabendu_sen
Active Contributor
0 Kudos

Hi Debashish,

You have mentioned purpose of your Custom Module is to convert Flat File to XML. So it should work at Sender File Adapter (Flat File -- Convert --> XML), but should not work at Target side because the module will get xml as Input (anything coming out of Integration Engine until your Interface working as Bypass ie. no ESR Objects), not Flat File.

That means your Module is actually working as a Converter from XML --> Flat File, not Flat File --> XML

former_member854360
Active Contributor
0 Kudos

Hi Nabendu,

My Module is for coverting Flat to XML and my scnerio is to bypass ESR(Dummy Interface).

So i configured the module in Receiver adapter(Flat-to XML). I am triggering Flat file from RWB test tab and my receiver module successfully convert flat to xml structure. But if i send the flat file from senderadapter then that receiver module is not working.

nabendu_sen
Active Contributor
0 Kudos

Hi Debashish,

Can you provide the screenshots of the sequence of the modules you maintained in the Adapter (Both Sender & Receiver)?

former_member854360
Active Contributor
0 Kudos

Hi Nabendu,

I will try to simplify the problem.

Created one file to file scenarion with Dummy interface.

In sender Adapter Config: NFS,Flat_File.txt, Only Callsapadapter Module.

In Receiver Adapter Cnfig: NFS,Converted_XML.xml,

                                    Module sequence.

                                          CUstomFlattoXMLBean

                                           CallSAP Adapter.

Now My Custom module works if i triggred the Flat file from RWB but it doesn,t work if i pickup the same flat file from sender adapter and forward to receiver channel.

nabendu_sen
Active Contributor
0 Kudos

Hi Debashish,

Thanks for the explanation. Please let us know when you run the Interface with Sender File Adapter:

1. In SXMB_MONI, what the Payload-Main Document you can see in Call Adapter step, is it Blank?

2. The File generated at Target, that one is too empty (Empty File)?

3. What is the Payload you can see at Receiver File Adapter in RWB - Communication Channel Monitoring? That's empty too?

former_member854360
Active Contributor
0 Kudos

Hi Nabendu,

1. In SXMB_MONI, what the Payload-Main Document you can see in Call Adapter step, is it Blank?

No payload contains Flat file.

2. The File generated at Target, that one is too empty (Empty File)?

Yes

3. What is the Payload you can see at Receiver File Adapter in RWB - Communication Channel Monitoring? That's empty too?

No input file to adapter is not empty(its the same flat file as SXMB_MONI) but after the custom module execution it becomes empty.

But While triggreng the interface from RWB it works fine..

So my custom Module  is able to convert the flat file when it is triggred from RWB . But while triggring via sender adapter its failing with empty payload.

former_member854360
Active Contributor
0 Kudos

Here is my code. How i am reading the input data.

msg = (Message) obj;
   msgType = (String) mc.getContextData("msgType");
   nameSpace = (String) mc.getContextData("nameSpace");
  
   key = new MessageKey(msg.getMessageId(), msg.getMessageDirection());
   PublicAPIAccess pa = PublicAPIAccessFactory.getPublicAPIAccess();
   Audit = pa.getAuditAccess();
  
  
    xp = msg.getDocument();
  

   fin =(InputStream) xp.getInputStream();

former_member854360
Active Contributor
0 Kudos

Hi Expert,

Any more input on this?

Former Member
0 Kudos

Hi,

For flat file to xml conversion you don't required to write custom module ,you can achieve the same using either MTB or FCC.

In your approach you can simply track the issue as below.

1)Open RWB/communication channel monitoring and select your sender channel and click on your message log,see whether your module got executed or not .

2)If it was executed successfully then in code write logs at different steps.You can track any issue by writing logs and putting try and catch blogs .

Regards

Venkat