cancel
Showing results for 
Search instead for 
Did you mean: 

Data syndication using MDM Java API

Former Member
0 Kudos

Hello,

Did someone succeed in syndicating data using the MDM Java API (Class SyndicatePortCommand) ?

The procedure in the javadoc isn't clear and there is no example for testing syndication through the Java API.

I wrote a class SyndicatePortExample adapted from the example in the javadoc.

So far, I have no success, when I call the method SyndicatePortCommand.execute, no exceptions is thrown but when I use getPortDataFilesCommand, nothing is retrieved?!

Did I miss something?

Greetings

PS: The SAP MDM version is 5.5.42.98 on AIX...

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Yang,

Did you got the solution for executing Syndication through Java MDM API?? If so can you please let us know where the problem was.

Basically i am trying to syndicate records by MDM API. But i dont find a proper example to do this.

Thanks,

Raags

Edited by: Raags on Jul 3, 2008 10:08 AM

Former Member
0 Kudos

Thanks for the tips, I checked my source code and I duplicated some functionalities from the example but still no syndicated data...

I also ran the example from the howto and still no syndicated data...

I will check the logs in the syndication server. Maybe I'll get a clue...

0 Kudos

Hi, Yan

Syndication through Java API is asynchronous. Also Syndication Server must be running.

Something curious happen here. If you syndicate a port or syndicate a particular record when MDSS is stopped, those syndications request are enqueued somewhere. When MDSS starts, those requested are then executed.

You may also use EventDispatcher class in order to be notified when a Syndication Event occurs.

Good luck

Former Member
0 Kudos

Hello,

Do you have any example of how to use this class? As you can expect, mdss was running, data in the table, the port actually works, manually and automatically, so I expected the class SyndicatePortCommand to work...

Unfortunately I have no documents or example on how to use syndication with the java API (only a few lines in the javadoc!!)

So I am making several experiments without success...

Greetings,

Yan Wong

PS: Before, we planned to use the CLI SyndicatorBatch.exe wrapped in a java class but since it has been removed...

0 Kudos

For better examples look at those documents

How to Use the MDM Java API for MDM SP05 Patch 2

How to Use the MDM Java API for MDM SP06 Patch 1

at

https://www.sdn.sap.com/irj/sdn/howtoguides?rid=/webcontent/uuid/c001599f-6ba1-2910-a380-b257e11de1f... [original link is broken]

The following code syndicate specific records with the class AddSyndicationRecordIdsCommand but i would expect that SyndicatePortCommand works similar

String portCode = "PORT_CODE";
String filePrefix = "SomeFilePrefix";
SimpleConnection connection;
String session;
PortProperties[] portList;
RecordId[] recordIds;
...

GetPortListCommand getPortsCmd = new GetPortListCommand(connection);
getPortsCmd.setSession(session);
getPortsCmd.execute();		
portList = getPortsCmd.getPorts();

//   Search a specific portCode
PortProperties port = null;
for (int i=0; i < portList.length; i++) {
	if (portCode.equals(portList<i>.getCode())) {
		port = portList<i>;
		break;
	}
}
if (port == null) {
	throw new RuntimeException("Can't syndicate, port doesn't exist" );
}

//   Call sindication
AddSyndicationRecordIdsCommand addSyndRecordCmd = new AddSyndicationRecordIdsCommand(connection);
addSyndRecordCmd.setSession(session);
addSyndRecordCmd.setFilePrefix(filePrefix);
addSyndRecordCmd.setPortId(port.getId());
addSyndRecordCmd.setRemoteSystemId(port.getRemoteSystemId());
addSyndRecordCmd.setRecordIds(recordIds);
addSyndRecordCmd.execute();