1

I'm planning on using a MSMQ for two way communication between Client and server. The clients will be a WCF hosted in Window services and communicating to the server over the internet. Obviously I have no control over the firewall,proxy,NAT on the client side,

so I'm wondering what is the proper way to set MSMQ netMsmqBinding ?

Right now in my intiial testing I'm running the server and client on the same pc and i am setting the binding as follows

    <!--Address attribute specifies the name of the MSMQ Queue.-->
    <endpoint name="msmqTransactionEndpoint" address="net.msmq://localhost/UpdateEmpTwoWay/UpdateEmp" binding="netMsmqBinding"
                      bindingConfiguration="myMSMQ" contract="EmployeeUpdateReportComponent.IEmployee"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    <host>
      <baseAddresses>
        <add baseAddress="net.msmq://localhost/private/"/>
        <!--Both Mex and HttpBinding uses http://localhost:8888 port-->
        <add baseAddress="http://localhost:57829"/>
      </baseAddresses>
    </host>
  </service>

But I have a feeling this won't work when deploying over the internet because "localhost" won't translate to the machine address (much less worrying about NAT translation) and that port,ICMP traffic might be blocked by the clients firewall .

What is the proper way to handle this issue ? I saw there Public and private queues ,which we have to setup .but i've not idea if i set public queues on server for Message Queuing then its will work or not .

so just tell me when win form wcf client apps will run then how can i open my custom port like "6667" and also guide me what library or what approach i should use as a result response should come from client side router to pc and firewall will not block anything. please discuss this issue with real life scenario how people handle this kind of situation in real life.

Note : if you've any other idea for two way communication between server and client ,let me know its too

thanks

Adam
  • 173
  • 2
  • 14

1 Answers1

0

MSMQ is for one way communication. One process sends items to the Queue and another reads them.

You could solve it by having two Queues, one that the Client Writes to and the server reads, and another that the server Writes to and the Client reads. But then there are problems when there is more than one Client, but there are ways around that, for example a Queue per Client.

I think that a better solution would be to use something like SignalR that is built for 2 way communication, have a look at: http://www.asp.net/signalr

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
  • yes i can solve it by having two queues .but my question was that I have no control over the firewall,proxy,NAT on the client side,if firewall blocking something like ICMP OR router disabled port forwarding etc . in that situation two way communication will work using MSMQ? You said to use SignalR for two way communication. i know SignalR support two way communication but Are you sure SignalR will work in case of Client Firewall or Router prevent Something ? – Adam Dec 31 '14 at 09:24