Examples

IBMStreams com.ibm.streamsx.messaging Toolkit > com.ibm.streamsx.messaging 5.4.3 > com.ibm.streamsx.messaging.xms > XMSSource > Examples

These examples demonstrate how to use the XMSSource operator.

This example demonstrates the use of multiple XMSSource operators with different parameter combinations.

composite Main {
graph
//XMSSource Operator with connections.xml 
//defaulted to ./etc/connections.xml
stream <int32 id, rstring fname, rstring lname>
MyPersonNamesStream  = XMSSource(){
	param 
		connection: "wbe";
		access: "OutTrading";
}    

//XMSSource operator with fully 
//qualified name of connections.xml
stream <int32 id, rstring fname, rstring lname>
MyPersonNamesStream = XMSSource(){
	param     
		connectionDocument:"/home/streamsuser/connections/XMSconnections.xml";
		connection: "wbe";  
		access: "OutTrading";
}    

//XMSSource Operator with the optional 
//error output port specified 
(stream <int32 id, rstring fname, rstring lname>; 
stream <rstring errorMessage> ErrorStream)  = XMSSource(){
	param                     
		connection: "wbe";
		access: "OutTrading";
}    

//XMSSource operator with the optional 
//initDelay and reconnectionPolicy specified
stream <int32 id, rstring fname, rstring lname>
MyPersonNamesStream = XMSSource(){
	param     
		connection: "wbe"; 
		access: "OutTrading";
		reconnectionPolicy: NoRetry;
		initDelay: 10.0;
}

//XMSSource operator with the optional period 
//and reconnectionPolicy specified
stream <int32 id, rstring fname, rstring lname> 
MyPersonNamesStream = XMSSource(){
	param     
		connection: "wbe"; 
		access: "OutTrading"; 
		reconnectionPolicy: InfiniteRetry;
		period: 1.20;
}
// XMSSource operator with the reconnectionPolicy
//specified as BoundedRetry
stream <int32 id, rstring fname, rstring lname>
MyPersonNamesStream = XMSSource(){
	param     
		connection: "wbe"; 
		access: "OutTrading"; 
		reconnectionPolicy: BoundedRetry;
		reconnectionBound: 2u;
		period: 1.20;
}
}

This example uses the same connections.xml that is provided in the example for the XMSSink operator.