Let me explain first how we have our environment setup currently. We have a MPG on each of our domains, that listens on a port we have given our Network team. Once a URL comes in on that port, based on the URI we will route that traffic to a web-service proxy we have configured. We only have 2 domains right now, so it's not a big task. The main reason for this is so all traffic comes in on the same port and datapower does the routing, rather than out network team having to do all the routing.
My questions is which of these 2 methods is best, or is there a 3rd or 4th option that may be better?
Method 1. Using an XML file to preform that routing. Creating a new domain that utilizes an XML file to route traffic to each WSP or service. It may also route traffic to a MPG if we decide some webservice does indeed need a MPG for transformations or anything.
Method 2. Use a similar MPG to preform the routing, but create a new domain and put the RoutingMPG on that domain that will route to all other services.
I believe both of these are better options than the way we current have our environment setup, but I am wondering which is better and if there are other options I am not away of. Datapower is new to us, so we are searching for the best method to start out with.
kenhygh 120000PD1B2354 Posts
Re: Webservice routing?2012-12-14T18:50:28ZThis is the accepted answer. This is the accepted answer.Chris,
You guys may be mixing up domains and services, where a service is a WPS or a WSP or XMLFW.
A Domain is a unit of management, a place to store configurations for a given set of work. Many people have multiple environments (dev, 1 or two test environments, etc) on a single box, each in its own domain.
Others, where they have multiple apps - each with its own set of MPGs/WSPs - will have a domain for each. In this situation, they might have a separate domain for the Router/Dispatcher MPG, so it can be deployed separately from the other, more application-centric domains.
Your routing, is that only within the box? or are you looking to do routing both in the RoutingMPG and in your WSPs?
Using an xml file - or set of xml files - to do the routing lookup is a very common pattern. One implementation is at http://www.ibm.com/developerworks/websphere/techjournal/0809_roytman/0809_roytman.html
SystemAdmin 110000D4XK6772 Posts
Re: Webservice routing?2012-12-14T19:35:35ZThis is the accepted answer. This is the accepted answer.
- kenhygh 120000PD1B
We have two domains on each of our appliances(for now). We have multiple appliances for different environments. Within each domain we have multiple services...aka...WSP, MPG. We do not use any XML firewalls at this time. And within each domain we have a MPG acting as a routing service. It intercepts the data, and routes it to the WSP that points to the webservice. I do not believe this is the ideal solution. As per my question, I am wanting to create a new domain that will act simply as a routing service for the whole environment(dev, production, etc). We would then essentially have the WSP's on whichever domains they are related to. And in the RoutingDomain we would have a RoutingMPG that points to WSP's in any domain.(It could also point to other MPGs if a webservice required an MPG rather than WSP). Instead of a RoutingMPG we could also as you say, have an XML file do the routing. Or even, as I've just come across, an XPath Routing Map can do the same thing, right?
So my main question is which is the best, and why?
kenhygh 120000PD1B2354 Posts
Re: Webservice routing?2012-12-14T20:38:29ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
Do not have common components serving multiple environments. So, you'll need a Routing service for each environment.
A Routing service can serve to another service whether it's in the same domain or not, just use http://127.0.0.1:port for whatever WSP (or other service, DP doesn't care) you're routing to.
Now, if your WSPs are doing nothing but routing, there's no need to have a separate service do that. Your Routing service could do the routing off-box itself.