Problem with Microsoft Message Queue

sanjeevasawalesanjeevasawale Member Posts: 63
](*,) Hi Friends,

As per example from Application Designer I have created 2 code units for sending and receiving messages in Navision.

For that I hv installed "Communication Componant/Bus Adapter"."Navision SDK".

As per App. Disgn. instruction m running Message Receiving codeunit 1st and from second session on the same client while running Send message codeunit am getting bellow error -
The call to member GetStream failed. SocketBusAdapter.SocketBusAdapter.1 returned the following message: Failed to connect to 127.0.0.1 on port 8079
Am also posting here sending code unit's codes


IF ISCLEAR(CC2) THEN
   CREATE(CC2);

IF ISCLEAR(SBA) THEN
   CREATE(SBA);

CC2.AddBusAdapter(SBA,0);
OutMsg := CC2.CreateoutMessage('Sockets://localhost:8079');

OutS := OutMsg.GetStream();
OutS.WRITE('My Message');


Is this problem because of Port code : 8079. If yes then which port no. need to give here and how to get port no of any client.

Please help my friends.

Sanjeev

Comments

  • DenSterDenSter Member Posts: 8,307
    The Socket busadapter is for TCP/IP Socket communication, not for MSMQ communication. For that you use the MQBusAdapter. Search for a file called 'devguide.chm' on your product CD and you will find lots of useful code examples how to use the communication component and the adapters. Note that they are limited though, so you will not have full MSMQ functionality using the comcom.
  • sanjeevasawalesanjeevasawale Member Posts: 63
    Thx 4 Reply :),

    I tried with its options also. So can u tell me what I need to install on my laptop and need to set parameters. As of now I have installed Communication Component and Bus Adapter. What more apart from this?

    Do I need to install Application Server for that..?

    Also if u hv code sample which run successfully please give me here.

    Thx

    Sanjeev
  • DenSterDenSter Member Posts: 8,307
    DenSter wrote:
    The Socket busadapter is for TCP/IP Socket communication, not for MSMQ communication. For that you use the MQBusAdapter. Search for a file called 'devguide.chm' on your product CD and you will find lots of useful code examples how to use the communication component and the adapters. Note that they are limited though, so you will not have full MSMQ functionality using the comcom.
    You should really read what people say :mrgreen: find the file, it has code examples.
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    Read the help file on Tools CD. Search for NAS or Application Server here at the downloads. You can also take a look at Navision Integration Framework in the downloads - it's still beta, but maybe it's useful as an example.

    You don't really need Application Server I think. You can just leave a client running on the server. However it's useful, because it throws the error messages into the event log instead of on the screen.
  • sanjeevasawalesanjeevasawale Member Posts: 63
    Hey Frndz,

    Believ me I already gone thru the help provided by Navision and tested its sample codes but i think something is missing due to which m getting the problem.

    I used socket with different port nos. I dont _stand which port to put and how to get port no.

    I tried Queue message but that also giving problem.

    Thats why m asking detail help coz that navision help doesnt cover the system requirement.

    Pls help.

    Regds,

    Sanjeev
  • DenSterDenSter Member Posts: 8,307
    I don't know what to say... I used the devguide samples and I got it to work by simply doing exactly what the code samples say, literally by copying and pasting the code from the help file into NAV objects. If you can't specify exactly where things go wrong, I won't know what the problem is and I won't be able to help.
  • sanjeevasawalesanjeevasawale Member Posts: 63
    Denster,

    Sorry 4 later reply. After defining changing SingleInstance Property of Receiving Codeunit problem solved. But when it receives message it receives lots of junk and empty messages along with sent message.

    One more thing I also installed Messaging Queue Component.

    Is it possible to receive particular message sent to me.


    I am using XP.
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    Why don't you check out the Navision Integration Framework in the downloads as an example? Message receiving works perfectly in it (only the reply seems to get lost for some reason).
  • DenSterDenSter Member Posts: 8,307
    Check this:
    - only the common MSMQ components are installed. The AD Integration part of MSMQ screws up the bus adapter for some reason. I've seen messages disappear and I got them when I uninstalled all MSMQ components except for the common ones.
    - Dedicate one message queue for your program. If other programs send messages into this message queue, you're going to receive those too and it will get confused. With the bus adapter you can't peek the queue, so you have to dedicate certain queues for your program
    - Set the receiving message queue to be a NON transactional queue. This is another limitation of the bus adapter, it does not know how to deal with a transactinal queue.
    - The message that is sent into your queue has to be a single byte character stream. In double byte encoding characters are represented by two pairs of numbers, and the second pair of single byte characters have the same value as EOS in single byte encoding, and this causes the bus adapter to think that it's the end of the stream, when in fact it's just the end of the first character.

    Could you please tell us what 'lots of junk' means?
  • sanjeevasawalesanjeevasawale Member Posts: 63
    Thx Buddies,

    Junk message means blank message box some time box character appears and then my message appear along with box character @ its end.

    Still Struggling with that problem. ](*,)
Sign In or Register to comment.