mqlight / java-mqlight

This Java package provides the high-level API by which you can interact with the MQ Light runtime.
Apache License 2.0
10 stars 9 forks source link

Fixes to the state machine transitions #38

Closed prestona closed 8 years ago

prestona commented 8 years ago

When the server closes a connection with a NotPermittedException, use the REPLACED transition rather than the STOPPED transition. This is because the REPLACED transition is used for the server having closed the connection, where as STOPPED assumes the client has sent a stop and waits for a response from the server (which in this case we're not going to get).

Update the FSM to allow a "fatal" response to an open (i.e. server rejects the client because it is not authorized) when the client is in retrying state. This is an omission in the original design of the FSM - as we only considered handling this kind of failure when the client first connects, not when it has already been connected and is in retrying state.

This fixes the following exception:

java.lang.IllegalStateException: No valid leaving transitions are permitted from
state 'Retrying2B' for trigger 'OPEN_RESP_FATAL'. Consider ignoring the trigger.