Why a session should be established before communicating?

asked 2015-07-19 18:51:45 -0700

eekshs16 gravatar image

I don't know the objective of session.

What is the advantage for session?

Is it possible to communicate like UDP (stateless)? (E.g. don't need to establish logical connection)

Is there any reasons to use a session which is a stateful notion?

Thank you for reading my question.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2015-07-29 02:05:55 -0700

praveenb gravatar image

Communicating via a session is useful because it adds a context, in the form of a session identifier. Consider a scenario where an application is talking with multiple other applications. It is important to be able to keep track of what is being communicated with whom. This context is automatically provided via sessions.

Sessions are required when an application connected to one routing node wants to communicate with another application connected to a different routing node. One can use both method request / responses and regular signals (which are fire-and-forget) when using sessions.

Strictly speaking, it is possible to communicate only using Sessionless signals (a.k.a store-and-persist signals) where a logical session need not be established. But the use case of Sessionless signals is meant to communicate low-frequency events. But sessions are needed for request/response communication. While not mandatory, sessions are strongly recommended for high-frequency events.

edit flag offensive delete publish link more

answered 2015-07-20 01:37:16 -0700

julianbros gravatar image

As far as I can see, stateless communication is done due to the use of signals.

Signals can be used if you don't care about the receiver, like when doing broadcasts or something related. If you want to use device specific functions of device B, then device A must know what kind of device is attached. The only possible way is due to the join of a session, to connect to a proxyBusObject. Please correct me if I'm wrong!

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-07-19 18:51:45 -0700

Seen: 70 times

Last updated: Jul 29 '15