cancel
Showing results for 
Search instead for 
Did you mean: 

Running Custom Adapter on one Cluster Node only

0 Kudos

Hi.
I've been developing a custom adapter following
Eng Swee Yeoh's great blog on this topic.

The adapter runs, but is not handling multiple nodes on the PO server very well.

Picking up files in Test mode are done simultaneously on each node and processed, creating duplet messages.

I’ve not been able to figure out how this could be handled by the provided framework.

An easy way to solve it, could be running the custom adapter on one cluster node only.

The standard SAP file (sender) adapter does this too, that is, running the adapter on one cluster node at a time for each poll interval!

Anyone know how to do this?

Other suggestions for duplet handling in the custom adapter are welcome

Best regards…

Peter

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Peter,


The adapter runs, but is not handling multiple nodes on the PO server very well.

Picking up files in Test mode are done simultaneously on each node and processed, creating duplet messages.

I'm curious as to how you made the file adapter use all four nodes. As far as I know, you can only use one node for the file sender because of locking issues. Are you sure this is not because of the test mode? Test mode polls the same file over and over, it is also the reason you are getting duplicate messages. Set the processing to delete and your issue will disappear. Just upload a new file if you want to test again.

Regards,

Mark

0 Kudos

Hi Mark.
I didn't.

It was the Custom Adapter which was polling on all nodes

Best regards...

Peter

vadimklimov
Active Contributor
0 Kudos

Hi Peter, all,

Polling adapters (like File or JDBC) make use of Adapter Framework Scheduler, that manages polling jobs. The adapter registers a polling task on the Adapter Framework Scheduler for every started polling adapter. Adapter Framework Scheduler in its turn is responsible for scheduling corresponding job on the specific cluster node and ensuring the polling job is only scheduled on a single node in a cluster (which avoids unwanted situation of multiple nodes executing same polling job / same polling attempt for a communication channel at the same time).

I could not find publicly available technical documentation that contains code snippets of the process of registration of the polling adapter tasks against Adapter Framework Scheduler (which is done using classes in the package com.sap.aii.af.lib.scheduler), so looking into logic of any standard polling adapter and replicating it is likely to be a way to go. For example, you may have a look into classes com.sap.aii.adapter.file.File2XI (for File adapter) or com.sap.aii.adapter.jdbcJDBC2XI (for JDBC adapter) to get better clue about this.

Regards,

Vadim

0 Kudos

Hi Vadim.
Thank you for your reply.

I have been looking into the file adapter for inspiration (File2XI), and did find code regarding to Lock and Scheduling. So are pretty sure you are right

I just need to figure out how to use it in the sample adapter.

Thank you again...

Best regards...

Peter

engswee
Active Contributor
0 Kudos

Dear Peter

Sorry that I was not able to respond to this earlier as I was away.

I'm glad that Vadim provided you with the much needed pointers to help you on your way. I did not do any testing on a multiple node environment, so to be honest, I'm also not sure of the behaviour and I would have suggested pretty much the same thing, which is to look into how SAP's adapter works.

I hope you did manage to figure things out in the end and got it working. If you did, may I suggest that you blog about it (when you do find some time on your hands) - there are plenty of gaps to fill for content in the adapter development in SCN, and it would definitely benefit a lot of members in the community both now and in the future.

Regards

Eng Swee

0 Kudos

Hi Eng Swee.
Thanks again for your great work regarding the custom adapter building...

Brilliant inspiration

Regarding the Scheduling and Locking, I did manage to solve the problem.

Unfortunately not using the existing framework.

I ended up building my own simple locking class.

Looking into the standard code revealed the way SAP works, but it is not portable to the sample adapter easily (for me at least), so after some time finding the classes, and trying to use them, without luck, I had to throw the towel into the ring. I ran out of time!

I haven't given up yet though... Will give it a look, when I have a little time left again

Best regards...

Peter

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Peter,
not sure it is available in custom developed adapter, but have a look at SAP Note #2029410 and check these parameters in your custom one.

Best regards,
Vadym

0 Kudos

Hi Vadym.

This note describes the same as the one Harish referred to above.

Only for the File Sender Adapter

Best regards...

Peter

Harish
Active Contributor
0 Kudos

Hi Peter,

did you tried the clustersync mode parameter?

1259515 - 'clusterSyncMode' is available as service property


regards,

Harish

0 Kudos

Hi Harish.
I'm not really sure if that would chance anything, since this parameter is for the XPI Adapter: File only.