Topic
2 replies Latest Post - ‏2013-03-02T16:07:06Z by SystemAdmin
SystemAdmin
SystemAdmin
1245 Posts
ACCEPTED ANSWER

Pinned topic XMSSource using a Topic

‏2013-03-01T17:25:44Z |
I've created a simple spl project to learn how to use the XMS operators. I've been able to successfully create a XMSSink to a queue, but I can't
seem to get the XMSSource from a queue to work. The project and communications xml are below:

namespace mqtester ;

use com.ibm.streams.messaging.xms::XMSSink ;
use com.ibm.streams.messaging.xms::XMSSource ;

composite Main
{
param
expression<rstring> $docLoc :
"/home/streamsuser/workspace/MQTestProject/ConnectionXML/XMSConnections.xml" ;
graph
stream<rstring message> TopicMessage = XMSSource()
{
param
connectionDocument : $docLoc ;
connection : "fox" ;
access : "ttester" ;
initDelay : 2.0 ;
config
logLevel : debug ;
}

//XMSSink Operator with the fully qualified name of connections.xml
() as PutQueueMessageSink = XMSSink(TopicMessage)
{
param
connectionDocument : $docLoc ;
connection : "don" ;
access : "tester" ;
config
logLevel : debug ;
}

() as ResultsFileSink = FileSink(TopicMessage) {
param file: "/home/streamsuser/message.out";
format: txt;
flush: 1u;
}
}

<?xml version="1.0" encoding="UTF-8"?>
<st:connections xmlns:st="http://www.ibm.com/xmlns/prod/streams/adapters"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<connection_specifications>
<connection_specification name="don">
<XMS
initial_context="file:///home/streamsuser/JNDI/"
connection_factory="TestCF"/>
</connection_specification>
<connection_specification name="fox">
<XMS
initial_context="file:///home/streamsuser/JNDI/"
connection_factory="TestTCF"/>
</connection_specification>
</connection_specifications>

<access_specifications>
<access_specification name="tester">
<!--
message_class can be:
bytes, empty, map, stream, wbe, wbe22, or xml
-->
<destination
identifier="TestQ"
delivery_mode="persistent"
message_class="bytes" />
<uses_connection connection="don"/>
<native_schema>
<attribute name="message" type="String" length="25" />
</native_schema>
</access_specification>
<access_specification name="ttester">
<destination
identifier="TestTopic"
delivery_mode="non_persistent"
message_class="bytes" />
<uses_connection connection="fox"/>
<native_schema>
<attribute name="message" type="String" length="25" />
</native_schema>
</access_specification>
</access_specifications>
</st:connections>

Any assistance will be greatly appreciated.

Regards
Don Fox
  • SystemAdmin
    SystemAdmin
    1245 Posts
    ACCEPTED ANSWER

    Re: XMSSource using a Topic

    ‏2013-03-01T17:27:37Z  in response to SystemAdmin
    oopa, I meant XMSSource from a topic..
  • SystemAdmin
    SystemAdmin
    1245 Posts
    ACCEPTED ANSWER

    Re: XMSSource using a Topic

    ‏2013-03-02T16:07:06Z  in response to SystemAdmin
    After some experimenting I found out why this wasn't working. It turns out that
    the message text that was being received by XMSSource was smaller than the
    definition (<attribute name="message" type="String" length="25" />) and was
    being discarded.