简体   繁体   中英

How to communicate from Azure web app to WCF services hosted locally in IIS?

I have an ASP.NET MVC application hosted in Azure. This application is complemented with a desktop application that also has WCF services for communicating with III party interfaces. WCF are hosted locally.

There are thousands of clients using the desktop application at different geographical locations. Till now, every desktop application used to talk to web app using api with the help of WCF. This was limited to on demand from the desktop application. Whenever desktop application feels the need to talk to web app, it used the way of web api from WCF.

Now, what I want is:- To access the different desktop applications(typically called sites), from azure depending upon the need. This is required on account of an online ordering system that is through web app/mobile app. I do not want to keep polling from desktop application to know about if any new order is there for this site. I feel it would be better if I can play from other side. Also, keeping in mind that IP of sites will not be fixed. There may be issue with firewall. NAT may translate resource identifier differently.

Can service bus in azure may be of any help, but what confuses me is that every desktop application is having its own WCF service and order should reach the respective site only.

Any type of ideas on this would be appreciated.

According to your description, Service Bus messaging is a perfect way to achieve this.

More information about Service Bus Messaging, we can refer to: Service Bus queues, topics, and subscriptions

In addition, We can also use RabbitMQ or ZeroMQ which is similar with Service Bus Messaging because both of them are free. You can choose an best way to realize your requirements.

About differences between ZeroMQ and RabbitMQ:

ZeroMQ has better performance, but it is built in the case of allowing message data loss to apply to high throughput / low latency applications. Unlike ZeroMQ, RabbitMQ fully implements the AMQP protocol, which is similar to mailbox services, supporting message persistence, transaction, congestion control, load balancing and so on, making RabbitMQ have a more extensive application scenario.

Function                    RabbitMQ                      ZeroMQ
Message persistence         Support                       Not Support
Transaction                 Support                       Not Support
performance                 Low                           High
stability                   High                          Low
Support for AMQP protocol   Support                       Not Support
Application scenario        Data loss is not allowed      High throughput

More information about RabbitMQ and ZeroMQ, we can refer to:

RabbitMQ

ZeroMQ

If you are able to modify the desktop applications, implementing a websockets connection with SignalR might be worth a look. The desktop applications sign up with a SignalR hub you provide. You can then push data to the clients from, for example an ASP.NET MVC app. It works very reliable and handles lots of connections well. It is typically used for realtime web communication but might be useful in your case, too.

The downside is probably, that the desktop app needs to initially sign up to a hub to receive push messages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM