login button

Clone mediator

Forums :

Hi, try to use clone mediator to put fix message into jms queue also and it has a strange behaviour like this:

FIX MESSAGE:
2008-08-22 14:36:15,235 [192.168.81.14-WSMA0003] [fix-Worker-6] INFO LogMediator To: ,WSAction: urn:mediate,SOAPAction: urn:mediate,MessageID: urn:uuid:C19FB8A51C5C2FFC53121940857
5628,Direction: response,Envelope: <?xml version='1.0' encoding='utf-8'?>EXEC" counter="4"><
field id="39">

MESSAGE PUTS ON JMS QUEUE:

2008-08-22 14:36:15,330 [192.168.81.14-WSMA0003] [SynapseWorker-6] INFO LogMediator To: ,WSAction: ,SOAPAction: ,MessageID: urn:uuid:EC67AB5FB4EA4DDDD833089429785231-1502010645,Di
rection: response,monitor = MONITOR SEQUENCE,Envelope: <?xml version='1.0' encoding='utf-8'?>EXEC" counter="4"><
![CDATA[]]>

CONFIGURATION FILE:

<?xml version="1.0" encoding="UTF-8"?>

file

file

file:C:\quickfixj\wso2\olimpic\syn-oli.cfg

file:C:\quickfixj\wso2\olimpic\syn-sender.cfg

dynamicQueues/client.messages

As you can see it lose the values.
Do you have an idea?

Thanks a log
Gianni

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hi Gianni, Can you please

Hi Gianni,

Can you please repost the configuration and the traced messages, it seems like the configuration is missing or a formatting issue. Or may be you can attach the files..

Thanks,
Ruwan Linton

No problem, i attach the

No problem, i attach the error file and synapse config file

AttachmentSize
synapse.xml4 KB
synapse.xml4 KB
wso2error.txt2.53 KB

Excuse me i attached wrong

Excuse me i attached wrong files.
These are the newer.

AttachmentSize
wso2error.txt2.89 KB
synapse.xml4 KB

Hi, This is really strange,

Hi,

This is really strange, but I couldn't reproduce this on the latest build. I am assuming that you are using the WSO2-ESB-1.7 this has to work.

Which proxy gives you these logs? Is it "prova_monitor" or "OlimpicOrderProxy"... I assume it is the former because it is the one which has been exposed over the fix transport. Under these circumstances this has to work.

Thanks,
Ruwan Linton

Hi Can we get this info into

Hi

Can we get this info into a JIRA if we suspect a bug, and then take it from there?

asankha

Asankha, I wrote a test case

Asankha,

I wrote a test case to load the provided message into synapse environment and tried to clone it and it worked perfectly with all the values. I don't think there is an issue with the cloning of the message.

Thanks,
Ruwan Linton

I have this problem with

I have this problem with FIX, if i use jms all works.

Hi, I will recreate the

Hi,
I will recreate the issue by using FIX transport, assume that problem comes with the 'OlimpicOrderProxy'.
Asanka A.

HI, i've modified

HI,
i've modified OlimpicOrderProxy like prova_monitor(killed outgoing sequence) and it doesn't works.

I really don't know where is the problem.

Ciao
Gianni

Using Clone mediator with FIX messages

Hi Gianni,

I did simulate your requirement by taking a FIX message in and clone it send the original message to another FIX endpoint and send the clone to a JMS (AMQP) instance. It is working without a problem and I have attached the configuration file I used.

Asanka A.

 

<definitions xmlns="http://ws.apache.org/ns/synapse">
	<proxy name="OrderProcesserProxy40" transports="fix">
		<target>
			<endpoint>
				<address
					uri="fix://localhost:19876?BeginString=FIX.4.0&amp;SenderCompID=SYNAPSE&amp;TargetCompID=EXEC" />
			</endpoint>
			<inSequence>
				<log level="full" />
				<clone continueParent="true">
					<target to="" soapAction="" sequence="monitor" />
				</clone>
			</inSequence>
			<outSequence>
				<log level="full" />
				<send />
			</outSequence>
		</target>

		<parameter name="transport.fix.AcceptorConfigURL">
			file:repository/conf/sample/resources/fix/fix-synapse.cfg
		</parameter>
		<parameter name="transport.fix.AcceptorMessageStore">
			file
		</parameter>
		<parameter name="transport.fix.InitiatorConfigURL">
			file:repository/conf/sample/resources/fix/synapse-sender.cfg
		</parameter>
		<parameter name="transport.fix.InitiatorMessageStore">
			file
		</parameter>
	</proxy>
	<sequence name="monitor">
		<log level="full" separator=",">
			<property name="monitor" value="MONITOR SEQUENCE" />
		</log>
		<send>
			<endpoint>
				<address
					uri="jms:/QpidStockQuoteService?transport.jms.ConnectionFactoryJNDIName=qpidConnectionfactory&amp;java.naming.factory.initial=org.apache.qpid.jndi.PropertiesFileInitialContextFactory&amp;java.naming.provider.url=repository/conf/sample/resources/fix/conn.properties&amp;transport.jms.ReplyDestination=replyQueue" />
			</endpoint>
		</send>
	</sequence>
</definitions>

Hi, i don't see differeces

Hi, i don't see differeces beetween mine and yours config except the jms uri but it doesn't works.

Hi Gianni, Can you use the

Hi Gianni,
Can you use the config file that I posted by relapsing the EPR (JMS connection) and send us the result.
Asanka A.

This is the result

This is the result

AttachmentSize
wsolog.txt37.14 KB

Hi Gianni,You have not

Hi Gianni, You have not replaced the JMS URI to the one you were using before "jms:/Order.Consumer?transport.jms.ConnectionFactory=myQueueConnectionFactory" It is searching for QPid libraries that I'm using, can you replace it and let me know the result.

Asanka A.

Config file for your test env

<definitions xmlns="http://ws.apache.org/ns/synapse">
	<proxy name="OrderProcesserProxy40" transports="fix">
		<target>
			<endpoint>
				<address
					uri="fix://WSMA0003:19878?BeginString=FIX.4.2&SenderCompID=SYNBNZ&TargetCompID=EXEC" />
			</endpoint>
			<inSequence>
				<log level="full" />
				<clone continueParent="true">
					<target to="" soapAction="" sequence="monitor" />
				</clone>
			</inSequence>
			<outSequence>
				<log level="full" />
				<send />
			</outSequence>
		</target>

		<parameter name="transport.fix.AcceptorConfigURL">
			file:C:\quickfixj\wso2\olimpic\syn-oli.cfg
		</parameter>
		<parameter name="transport.fix.AcceptorMessageStore">
			file
		</parameter>
		<parameter name="transport.fix.InitiatorConfigURL">
			file:C:\quickfixj\wso2\olimpic\syn-sender.cfg
		</parameter>
		<parameter name="transport.fix.InitiatorMessageStore">
			file
		</parameter>
	</proxy>
	<sequence name="monitor">
		<log level="full" separator=",">
			<property name="monitor" value="MONITOR SEQUENCE" />
		</log>
		<send>
			<endpoint>
				<address
					uri="jms:/monitor.messages?transport.jms.ConnectionFactory=myQueueConnectionFactory" />
			</endpoint>
		</send>
	</sequence>
</definitions>

This is the new result

This is the new result

AttachmentSize
wsolog.txt26.55 KB

Hi Gianni, Based on the log,

Hi Gianni,
Based on the log, first/original message dispatch to the FIX endpoint and the clone dispatch to the JMS endpoint (Queue), and no errors in the log.
Does the order single message reached to your endpoints ?
Asanka A.

I've no errors in the log

I've no errors in the log file but if you see the message, logged into monitor sequence after the clone mediator, has no values. This is my problem.

Thanks
Gianni

Message before clone

Message before clone (Original)

2008-08-27 13:58:45,882 [192.168.81.14-WSMA0003] [fix-Worker-2]  INFO LogMediator To: ,WSAction: urn:mediate,SOAPAction: urn:mediate,MessageID: urn:uuid:B8594B5E178CA9555C1219838326297,Direction: request,Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><message inSession="FIX.4.2:SYNBNZ->OLIMPIC" counter="2"><header><field id="8"><![CDATA[FIX.4.2]]></field><field id="9"><![CDATA[161]]></field><field id="34"><![CDATA[1128]]></field><field id="35"><![CDATA[D]]></field><field id="49"><![CDATA[OLIMPIC]]></field><field id="52"><![CDATA[20080827-11:58:45.877]]></field><field id="56"><![CDATA[SYNBNZ]]></field></header><body><field id="11"><![CDATA[10]]></field><field id="15"><![CDATA[CHF]]></field><field id="21"><![CDATA[1]]></field><field id="22"><![CDATA[4]]></field><field id="38"><![CDATA[130]]></field><field id="40"><![CDATA[1]]></field><field id="48"><![CDATA[CH1122221711]]></field><field id="54"><![CDATA[1]]></field><field id="55"><![CDATA[000]]></field><field id="59"><![CDATA[0]]></field><field id="60"><![CDATA[20080827-11:58:45.836]]></field><field id="207"><![CDATA[XSWX]]></field></body><trailer><field id="10"><![CDATA[022]]></field></trailer></message></soapenv:Body></soapenv:Envelope>

Cloned message after the clone mediator executed

2008-08-27 13:58:45,886 [192.168.81.14-WSMA0003] [SynapseWorker-2]  INFO LogMediator To: ,WSAction: ,SOAPAction: ,MessageID: urn:uuid:10E16E5A198DE81150462836020060656866150075,Direction: request,monitor = MONITOR1 SEQUENCE,Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><message inSession="FIX.4.2:SYNBNZ->OLIMPIC" counter="2"><header><field id="8"><![CDATA[]]></field><field id="9"><![CDATA[]]></field><field id="34"><![CDATA[]]></field><field id="35"><![CDATA[]]></field><field id="49"><![CDATA[]]></field><field id="52"><![CDATA[]]></field><field id="56"><![CDATA[]]></field></header><body><field id="11"><![CDATA[]]></field><field id="15"><![CDATA[]]></field><field id="21"><![CDATA[]]></field><field id="22"><![CDATA[]]></field><field id="38"><![CDATA[]]></field><field id="40"><![CDATA[]]></field><field id="48"><![CDATA[]]></field><field id="54"><![CDATA[]]></field><field id="55"><![CDATA[]]></field><field id="59"><![CDATA[]]></field><field id="60"><![CDATA[]]></field><field id="207"><![CDATA[]]></field></body><trailer><field id="10"><![CDATA[]]></field></trailer></message></soapenv:Body></soapenv:Envelope>

 

Can you point me to the missing values, pls.

Thx

Asanka A.

This is the first field of

This is the first field of Fix message:

Message before clone (Original)

Cloned message after the clone mediator executed

Thanks
Gianni

Excuse me, the fields ar

Excuse me, the fields ar into the atteched file

AttachmentSize
fields.txt170 bytes

Hi Gianni, Yes based on your

Hi Gianni,
Yes based on your log values inside CDATA section is missing after clone, I will check this on my test environment and will get back to you.
Asanka A.

Hi Gianni, I did simulate

Hi Gianni,

I did simulate your problem again, but in my workspace I'm getting the values for CDATA after clone. I have attached my output in a text file. Can you replace the synapse libraries by getting a latest source distribution from the svn trunk. Follow the instructions that I explained you in the previous forum post[1], but make sure to replace all the libraries this time (previous case we replaced only the transport library)

Asanka A.

[1]http://wso2.org/forum/thread/3913#comment-6395

AttachmentSize
synapse-out.txt2.51 KB

Hi, when i compile i get

Hi, when i compile i get this error

Thanks
Gianni

AttachmentSize
builderr.txt9.86 KB

Hi, i followed yours

Hi, i followed yours instructions but i'm not able to compile.
In the middle i've created my clone mediator changing this method:

public static SOAPEnvelope cloneSOAPEnvelope(SOAPEnvelope envelope) {
SOAPEnvelope newEnvelope;
if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI
.equals(envelope.getBody().getNamespace().getNamespaceURI())) {
newEnvelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
} else {
newEnvelope = OMAbstractFactory.getSOAP12Factory().getDefaultEnvelope();
}

if (envelope.getHeader() != null) {
Iterator itr = envelope.getHeader().cloneOMElement().getChildren();
while (itr.hasNext()) {
newEnvelope.getHeader().addChild((OMNode) itr.next());
}
}

if (envelope.getBody() != null) {
//Iterator itr = envelope.getBody().cloneOMElement().getChildren();
Iterator itr = envelope.getBody().getChildren();
while (itr.hasNext()) {
OMNode n = (OMNode) itr.next();
newEnvelope.getBody().addChild(n);
}
}

return newEnvelope;
}

instead to use "Iterator itr = envelope.getBody().cloneOMElement().getChildren();"
i use "Iterator itr = envelope.getBody().getChildren();"

and it works.

i've modified olso the original but i'm not able to compile.

Do you have some suggest?

Thanks a lot
Gianni

Hi Gianni, I will upload the

Hi Gianni,
I will upload the synapse libraries that I'm using to a common place and send you the download instructions. Will re run your test using those libraries and check the output.
BW how do you generate the incoming FIX message,is it using Banzai ?
Asanka A.

Download instructions

Hi Gianni,

Please follow the following instructions to download the Synapse library files.

Asanka A.

Protocol : sftp

Host : ww2.wso2.org

User : guestftp

Password : wso2##@Alions

If you are using a Win32 operating system you can use WinSCP client to download, or can use cygwin.

Instructions for linux and cygwin

 

:~$ sftp guestftp@ww2.wso2.org

Type the password

sftp> get synapse* /opt/wso2
Fetching /var/www/public_ftp/guestftp/synapse-SNAPSHOT-lib.tar.gz to /opt/wso2/synapse-SNAPSHOT-lib.tar.gz
/var/www/public_ftp/guestftp/synapse-SNAPSHOT 100%  950KB  95.0KB/s   00:10    
sftp> 

This will copy the file to /opt/wso2 folder in your local machine.
Extract the archive

tar -xvzf synapse-SNAPSHOT-lib.tar.gz

Replace your existing synapse libraries with new ones.

Thanks a lot for your

Thanks a lot for your patience.
I substituted the libraries but nothing changed, at this point i don't understand what is wrong in my environment.

Gianni

Runtime Enviornment

Hi Gianni,

Can you send me the exact environment that you are using to run the ESB, including the OS and the JDK/JRE version.

Asanka A.

Hi, this is my

Hi,
this is my environment:
Windows Vista
WSO2 1.7
ActiveMQ 1.5

Thanks
Gianni

Will test this in the exact

Will test this in the exact environment and get back to you.
Asanka A.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.