XmlBlaster Logo

REQUIREMENT

engine.qos.login.session

XmlBlaster Logo


Type NEW
Priority MEDIUM
Status CLOSED
Topic Clients of XmlBlaster can use configurable session parameters on login
Des
cription

The login mode is session based. This allows multiple logins for the same client. The logins are distinguished by a unique, random session ID.

Clients login to xmlBlaster with the connect() method. They deliver a ConnectQos - a XML based quality of service string describing their configuration.

A client session has a default duration of 24 hours (this is configurable). Every client request (like publish(), subscribe() etc.) refreshes the duration of the session. After 24 hours of inactivity the session expires.

Note that client callbacks don't refresh the session timer. If you have a client which does only subscribe and does no other activities you need to set the session timeout to indefinitely or you need to call early enough xmlBlasterAccess.refreshSession() or a faked invocation like get() to avoid that the subscriber is suddenly disconnected. On the other hand, this can be used to limit the life span of a subscribe.
You may wonder why a successful update does not refresh the session: The answer is that in such a case a crashed publisher would have impact on the subscriber, another reason is that the updateOneway() invocation can not reliably check the subscriber status.

Every client may have a maximum of 10 sessions, other values are configurable. On demand a connect() can kill all other sessions of this client. If the maximum is reached, an XmlBlasterException is thrown on login.

XmlBlaster allows to check clients with a ping to the callback server. The ping frequency is adjustable at login time by the client itself. A client session disappears when it does a logout or on failure (ping() or update() fails after configured retry attempts) or on session-timeout or when clearSessions='true' is set.

Interested parties can subscribe on Login/Logout events, to find out if a client arrives or disappears. This needs to be configured using the admin.events plugin.

Example
Java

<!-- Simple QoS of the connect() method, this raw string is delivered to xmlBlaster -->
<qos>
   <securityService type="simple" version="1.0"> <!-- protected by CDATA -->
      <user>michele</user>
      <passwd>secret</passwd>
   </securityService>

   <session timeout='3600000' maxSessions='20' clearSessions='false'/>

   <callback type='XMLRPC' sessionId='sldg03loQ22'>
      http:/www.mars.universe:8080/RPC2
   </callback>
</qos>

   
Configure

These parameters allow to configure the xmlBlaster server default behavior.

Property Default Description Implemented
session.timeout 86400000 Default session span of life is one day, given in millis. 0 sets default life span to infinite. yes
session.maxSessions 10 Maximum of ten parallel logins for the same client yes

These parameters can be specified on client side with java clients (see ConnectQos API).

Other programming languages need to supply these setting with a raw XML string (see example section above).

Property Default Description Implemented
session.timeout 86400000 Session span of life is one day, given in millis. 0 sets life span to infinite. yes
session.maxSessions 10 Maximum of ten parallel logins for the same client yes
session.clearSessions false Clear on login all other sessions of this user (for recovery reasons) yes

NOTE: Configuration parameters are specified on command line (-someValue 17) or in the xmlBlaster.properties file (someValue=17). See requirement "util.property" for details.
Columns named Impl tells you if the feature is implemented.
Columns named Hot tells you if the configuration is changeable in hot operation.

See REQ protocol
See REQ engine.callback
See REQ engine.qos.login.callback
See REQ util.property
See REQ util.property.args
See REQ util.property.env
See API org.xmlBlaster.client.qos.ConnectQos
See TEST org.xmlBlaster.test.authentication.TestSession

This page is generated from the requirement XML file xmlBlaster/doc/requirements/engine.qos.login.session.xml

Back to overview