M
M
mitaichik2017-02-19 23:44:53
Java
mitaichik, 2017-02-19 23:44:53

Spring Integration: how to make a socket that understands multiple commands?

Hello! Question on the best practice of Spring Integration, I just started to study it:
According to the Spring Integration manual, I made a socket server. Commands come to one service-activator, everything works. But my socket should accept several different commands with different payloads (should come in json and map to the appropriate class, which each command has its own). Question: how to force a socket to process different commands?
The first thing that comes is to determine what the command is in the service-activator method, and pull the corresponding method of the corresponding service, but it seems to me that such an approach is not in the spirit of Spring Integration.
The second way is to use routers and make some service-activator activators. Is this approach correct?
Can you tell me how this is usually done? Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aol-nnov, 2017-02-20
@mitaichik

Sprint Integration. Part 6: Message Routing :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question