I had to a incorporate several legacy applications and services in a network-distributed application. The existing services and applications are written using different languages and technologies, including: java, C#.Net and C++; all running on MS Windows machines. Now I'm wondering about the communication mechanism between them. What is the simple and standard way? Thanks! PS. communications include simple message sending and remote method invocations.
7 Answers
Unfortunately there is no such thing as "the standard solution", so you have to figure out what your requirements are and from that choose the option that fits best.
Here are few options.
For a network application integration perspective SOAP over http might be the best(laborious but transparent) way to find a means to create the integration.
The windows platform itself provides different means of integration as well. Windows process to windows process communication might be solved bij (D)COM or named pipes(if on same machine), even RPC might solve your needs.
For your java application you would be able to use JNDI to create a native integration to the c++ app and from there you would be able to go to (D)COM even, so there are plenty of options.
If you can afford it, BizTalk is directly targeted at this kind of problem. It has a consistent programming model, so if you can create a BizTalk adapter for each of your isolated systems, you can create BizTalk orchestrations to control the flow of information between all of those systems. It's also quite performant in my experience.
You could try using ZeroMQ, a modern, open source library for networked communications that has bindings for C++, .NET, Java and most languages you can think of.
From the ZeroMQ landing page:
The socket library that acts as a concurrency framework.
Ø Faster than TCP, for clustered products and supercomputing.
Ø Carries messages across inproc, IPC, TCP, and multicast.
Ø Connect N-to-N via fanout, pubsub, pipeline, request-reply.
Ø Asynch I/O for scalable multicore message-passing apps.
Ø Large and active open source community.
Ø 30+ languages including C, C++, Java, .NET, Python.
Ø Most OSes including Linux, Windows, OS X.
Ø LGPL free software with full commercial support from iMatix.
ZeroMQ does not specify the format of your messages so you can use whatever serialization you prefer, although you'd want a serialization that was type compatible with .NET/Java/C++.
If they all are running on windows machines I would look at msmq I'm sure that all have implementations. If you need more then just communication I would then look at biz talk and lastly if ever need to work with different systems IBM MQ is the best product that IBM does and is rock steady reliable.
It depends on how low level each service is. For the lower level services, I would use a binary messaging approach, like Google's protobuf library.
For the higher level services (and certainly for external facing services), I'd use SOAP or REST via an application server (WebLogic, JBoss) or something simpler (Apache, IIS).
I absolutely recommend 'Enterprise Integration Patterns' by Gregor Hohpe and Bobby Wolfe. It suggests patterns for using messaging for exactly your problem.
IP is the least common denominator of most computers in this world. All languages have access to the IP stack of the OS.
-
I know I can use IP but my question is that how to do it? maybe I need to put middle server for translation message between apps or maybe I should use soap or WCF or ....?– sjtaheriCommented Oct 20, 2011 at 8:03
-
Usually I use multicast on raw UDP/IP when I know that my local network doesn't corrupt messages. You need to get familiar with socket programming. Commented Oct 20, 2011 at 8:09