2
Vote

Send message in string format

description

Hi,
 
I could successfully send a message[with body value as xml] to the transactional and nontransactional queue using the TestClient.java.
The NServiceBus is confugure to read the content from msmq.
 
The sample you have provided is sending the data in bytes(binary) format. Unfortuantely the client i.e. NServiceBus is facing difficulty to read the binary content sent from java.
It may not be possible to deserialize an object done in Java:
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/f144fc3b-a533-4957-992f-481ff44495a3
 
The MSMQJava native api does allow to send message string.
private native int nativeSend(String messageString, int length, String label, String correlationId, int transactionFlag); -> // in Queue.java
 
And I have amended the TestClient.java to send body in text format to private transactional queue.
as follows
 
[C]reate [O]pen [R]eceive [S]end [T]TransactionalText [B]TransactionalByte [P]eek [X]close [D]elete [I]nfo or [Q]uit?
==> o
Name of Queue? finance.bus.endpoints.financialtransaction.input
 
Name of Queue Server (ENTER for local)? uk00330
open (DIRECT=OS:uk00330\private$\finance.bus.endpoints.financialtransaction.input)
open: OK.
 
[C]reate [O]pen [R]eceive [S]end [T]TransactionalText [B]TransactionalByte [P]eek [X]close [D]elete [I]nfo or [Q]uit?
==> t
body ([from:Java] [time:2010-07-02 14:55:29BST])
Exception in thread "main" java.lang.UnsatisfiedLinkError: nativeSend
at ionic.Msmq.Queue.nativeSend(Native Method)
at ionic.Msmq.Queue.sendText(Unknown Source)
at com.beazley.msmq.les.tests.TestClient.SendTextNTransactional(Unknown Source)
at com.beazley.msmq.les.tests.TestClient.Run(Unknown Source)
at com.beazley.msmq.les.tests.TestClient.main(Unknown Source)
 
 
Could you please check whats wrong with my code[Please note the changes for Transactional queue is working for me.]
Is there is any possiblity to send the body in text format.
 
Thanks
Mithu

file attachments

comments

mithumazumdar wrote Jul 2, 2010 at 3:51 PM

I would appreciate if you could reply soon.

wrote Aug 4, 2011 at 2:21 PM

wrote Feb 14, 2013 at 3:35 AM

zanaty1 wrote Oct 29, 2016 at 4:38 AM

any update