Message Queue with NAV integration

HI Members,

I need to know the Configurations about Message queue with NAV integration.Can u any one provide the steps .I struggled from 10 days.

I saw one C/AL Code.it throws an error at the first line of code.Even I don’t know C/AL code.Please suggest me .

The Architecture like below.

pastedimage1533559451126v1.png

Regards,

Pavan G.

Without posting the “first line of code” which throws an error, and the exact error details, nobody can help.

It’s like you say: “We have weather outside, please suggest what to wear”.

I wrote the code like below and when i want to initialize the variables(Comcom,MQBus) in C/AL Global variable.i have given the Datatypes of those variables but it doesn’t show the sub type of variables.if i run the C/AL Code , it throws “A sub type of variable is not intialized”.

OnRun()
CREATE(Comcom);

CREATE(MQBus);
MQBus.OpenWriteQueue(‘My-pc2\Myqueue’,0,0);
Comcom.AddBusAdapter(MQBus,0);

ComOut := Comcom.CreateoutMessage(‘Message queue://’);
OutStr := ComOut.GetStream;
OutStr.WRITE(‘This is my message.’);

ComOut.Send(0);

[emoticon:0e469978eb8947d18b9c41123db3725a][emoticon:3538c4cf445e41d4b2832fbe9d022428][emoticon:1435ff2429184e17bc948e4f19178e1e]

The code you try is intended for NAV2009 or earlier utilizing AutomationServer objects that have been supported those days.
I’m not sure you can still use them.

Ok Thomas,

Then u give me the suggestions ,I’m using NAV 2016.Give me the steps .I googled it,i got this code only ,thats’y i tried with that code.Please Suggest me ,what you are using now.

Thanks,

Pavan.

I gave you the code yesterday. You are just ignoring it.
You even got an example how to send data to a message queue and how to receive data from a message queue.

If you do not know a certain command (like STRSUBSTNO), then google that command.

You will rarely find somebody writing the complete code for you.

If you don’t know anything about C/AL and development inside Dynamics NAV… Then DON’T DO IT! Get someone to do it for you. Perhaps sitting next to you. The stuff that you want to do right now has pieces that are elementary for NAV development.

Also doing development inside NAV is not like any other development task, you simply have to know a lot about accounting. If you don’t know anything about counting… sorry to say then you can *** (spelled wrongly) up everything for a lot of other people.

Think like this… It is hard to do a handbrake-turn in a car, if you don’t know how to drive. It safer to let an experienced person do it for you.

this is for Send the message right ?.

MessageQueue := MessageQueue.MessageQueue(STRSUBSTNO(‘FormatName:DIRECT=%3:%1\PRIVATE$%2’,Recipient.“TCP/IP Address”,Receipient.“MessageQueue Name”,ProtocolName));
MessageQueue.Formatter := BinaryFormatter.BinaryMessageFormatter();
Msg := Msg.Message();
Msg.BodyStream := InStrm;
MessageQueue.Send(Msg);

and this is for receiving right ?.

MessageQueue := MessageQueue.MessageQueue(MessageQueueName);
MessageQueue.Formatter := BinaryFormatter.BinaryMessageFormatter();
MessageEnumerator := MessageQueue.GetEnumerator();
WHILE MessageEnumerator.MoveNext() DO BEGIN
Message := MessageEnumerator.Current;
Message.Formatter := BinaryFormatter.BinaryMessageFormatter();
InStrm := Message.BodyStream;
// Do something with the message stream
MessageEnumerator.RemoveCurrent();
END;

i will try to do it Thomas.i will get back to u if i stuck any where.

Once again thank u very much for your patience and helping.

that is correct.

The 1st code will create a message and send the content of the InStream to the private queue with the name stored in Receipient.“MessageQueue Name” to the computer where the name or IP address is stored in Recipient.“TCP/IP Address” using the protocol as stored in the ProtocolName variable.

the second code will receive all messages and provide the content in the InStrm variable.

For additional information on how to use the Message Queues, refer to https://msdn.microsoft.com/en-us/library/system.messaging.messagequeue(v=vs.110).aspx