cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Module Bean-Sender Mail Adapter

0 Kudos

Hi Team,

We are using attached code(Module bean) in fetching the mails/attachments from mail box and we see mail adapter getting hung frequently with below error and on simple restart of communication channel mails will be polled without any issues

"at java.net.SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I(Native Method)"

SAP suggested to have Connection timeout setting in the code to fix this issue as this issue is due to custom module bean and I request you to check the code and share your thoughts/suggestions to implement timeout code to fix this issue.

Code:

nfeattachmenthandlerbean-002.txt

Accepted Solutions (1)

Accepted Solutions (1)

dilipkkp2412
Contributor

Hi Vishali,

You are doing like below in your ModuleCode:

  • 1. reading/parsing incoming message stream
  • 2. iterating over attachment list (loop)
  • 2.1. checking each file's contentType
  • 2.2. checking "UnicodeBOMInputStream" and then reading/writing to new buffer and setting contentType, name etc
  • 2.3. then creating new message.
  • And due to loop, only last attachment will be sent to receiver side.
  • This all will always make performance issue.

You should take reference of below blog (please note, below blog-example is to store attachments in to sap-ecc directory)

And w.r.t. your requirement, you should be doing below:

  • Instead of File-writing into directory (as given in blog example), do your stuffs
  • and try to minimize "writing audit log entry messages" within loop.
  • and if you requirement is to work with only attachment, then avoid parsing n all for incoming message stream (as seen in your code)

Thanks & Regards,

Dilip

Answers (1)

Answers (1)

0 Kudos

Thanks for your quick help Dilip, will try to customize the same and get back to you