Proxy Service & Business Service - oracle

Can i use a proxy service without a business service while configuring message flows in Oracle service bus? If so is what scenarios would we use it?

You can create a proxy service that does not use a business service.
Some reasons for such an approach is to create a common proxy module that is used by other proxy services that may do some common message processing before forwarding to a business service.

I think you cannot create a proxy service without a business service call in OSB, but you can call dummy business services that publish on a JMS topic that nobody listens on. This kind of proxy service could implement data transformation (e.g. XSLT) between the request and response, or enrich the response with data retrieved from a lookup table (fn-bea:execute-sql()).
A service bus, like OSB is meant to provide a façade to back-end (business) services: route to and compose existing services. What you are asking for is to create new back-end services which is more suited for Java EE servers or Oracle BPEL.
Update: You can create stand-alone proxy service, if you use pipeline pair and stage, but no route steps.

You can create a proxy service without a business service. A simple scenario is suppose you want to fetch the data from the queue, could be jms or mq, and you don't want to do anything with that data. You just simply want to empty the queue and do not want to store the message. In this case, your purpose can be fulfilled by simply creating a proxy service.

Related

How to deploy a nameko microservice

I've been reading through the nameko docs, and it is all good and clear, except for one part.
How do you actually deploy your nameko microservice?
I mean, it is clear how we deploy RESTful APIs in flask_restful, for instance. But with nameko?
If two microservices should communicate, how do we move them into the "listening" state?
I am not sure I understand your problem.
For each nameko service you define AMQP_URI constant that point to your RabbitMQ instance.
If each of your services have the same AMQP_URI, it make possible communication through sending rpc calls (where you have a queue per service endpoint) or using pub/sub messaging because service use the same RabbitMQ instance.
You can also have HTTP REST API. You must define endpoint in nameko service with http decorator (see example here: https://nameko.readthedocs.io/en/stable/built_in_extensions.html). In your confguration you have to define PORT for you web server, e.g. port 8000: WEB_SERVER_ADDRESS: 0.0.0.0:8000. And make this port accessible for the World.

Extra layer for communication from client to Service via client ->Api->ESB->Service

We are architecting a new system where ESB is the centerline channel for service communication. as we don't want our HTML/js client to interact with a bus directly, so we decided to introduce Api (ReST-API) layer where the client will post request to Api than API will put a message in ESB and respective service will subscribe for that particular message and will process it.
so it will be like
UI -> Rest -> ESB -> Service
As I knew no other services will not be interested in this particular message. so just wondering cant we do below??
UI->Rest-> Service and keep ESB used for only inter-service communications not from UI to service path. considering there will be 1000's of UI to service communication.
It all depends on how many subscribers(services) would need this message that is coming from UI. As of now you have identified just one service that needs this data. Introducing an ESB layer would decouple the "Rest" and "Service" layers and in the future if there are more services needing this message, a little change in ESB layer would be sufficient to meet your future needs without disturbing the "Rest" and "Service". Without ESB, you end-up in a tightly coupled pattern. Also, if the service is enhanced in the future, ESB could play a role in data transformation.

creating multiple instances of microservice and pointing each instance to its respective configurations dynamically

I know there is a way (setting the port to 0) to create multiple instances of a microservice dynamically.
My requirement is, I have a set of multiple clients and each client will have its corresponding business logic implemented its corresponding implementation class.
I have a factory method design pattern to return me the corresponding implementation class based on the client ID I pass to the factory method.
I want to deploy it as a microservice for one client. For the remaining clients, the microservice should be instantiated dynamically for each client ID and its corresponding implementation class should process its business logic based on the client ID passed to the factory method.
Is it possible technically using spring cloud?
If your service already has the business logic implemented for every client, I don't quite understand why you would want to instantiate another micro service for every client. The one service already deployed should work if you can manage to send in the client ids.
If the deployment is on client's servers, it's not a good idea to have all the clients' business logic code in one service.

Microservice synchronous communication - service to service or message broker

I am developing a series of microservices using Spring Boot and Kafka. For asynchronous communication, I am using Kafka which is working well.
I have a use case where I require synchronous communication between two microservices (a user registers a profile via the user profile service which needs to create an auth account in the auth microservice).
Should I just call the auth service directly (service to service communication) or should I use Kafka?
Any examples or best practise advice would be appreciated.
There are multiple factors that can drive your decision:
Required any acknowledgement from your Auth Service?
if yes:
For Immediate acknowledgement, use http
For not so immediate acknowledgement, Callback pattern can be implemented.
In your case, user profile sends request via Kafka to auth service and it calls
endpoint of user-profile to report status of the job.
if no:
Use queue one for better resiliency.
Error Handling
Think of auth service failure? What should be the reaction of user service ?
if on auth-service failure, user-service should also fail
Use http
if on auth-service failure, user service should not fails.
Use queue
Ideally in user creation and authentication realtime response is given to the client side but if it involves complex process or tasks post user creation queue should be preferred.
For multiple microservices synchronous interaction and to work on their API responses you can build a aggregator service which could serve as a communication medium between different services and work alongside your kafka queue consumer service.

How to call a OSB Proxy Service(JMS Transport) from a java client?

Hi I have a proxy service of transport type (JMS). It listens to a queue and when a message is posted in IN queue, it will route to a business service which would put the message in an OUT queue.
Now, I have a requirement where, from a java client I want to call the proxy service and pass the message content that it can route to business service which will put the message in out queue.
Is it possible? Is yes, how?
P.S: I searched in the internet about this and found we can call a proxy service just as a web service. Is it possible with JMS transport proxy service ?
A proxy cannot accept both HTTP and JMS at the same time - they are bound to a particular type of transport.
However, you can create a proxy chain like so:
A local-transport proxy (Let's call it MyService-local.proxy) that does the business logic and routes to the business service.
A small proxy that exposes a SOAP or REST endpoint (Let's call it MyService-http.proxy) and routes to MyService-local
Another proxy that reads from a JMS queue (call it MyService-jms.proxy) and routes to MyService-local.
Alternatively, if you dont want to change the OSB service, I suppose you could also write Java code to create a JMS message and put it on the original queue.

Resources