I have an application that uses a Consumer to subscribe to a JMS topic via LCDS. I'm working on setting up clustering for my application. What I'm seeing is that Flex is able to detect when its RTMP connection to the server dies (i.e. when I kill -9 the server). It then immediately tries to fail over and connect to another server in my cluster. After the connection is established, it tries to subscribe to my JMS topic. In my tests, if the JMS server throws an exception while LCDS is attempting to subscribe to the topic, LCDS is able to see that it didn't subscribe successfully:
10:39:15,880 INFO [STDOUT] [LCDS]JMS consumer for JMS destination 'topic/sample' is being removed from the JMS adapter due to the following error: A failure has occurred during processing of the request. Please consult the server logs for more details. SessionEndpoint[d2-6kc80vvf-1-tjq4yuvf-65evyd-z2u2da] createConsumerDelegate [g2-xcd80vvf-1-tjq4yuvf-65evyd-z2u2da]
Then it tries to send an error message to my application, via the topic that it wasn't able to subscribe to!
10:39:15,939 INFO [STDOUT] [LCDS]Serializing AMF/RTMP push
Version: 3
(Command method=receive (0) trxId=null)
(Typed Object #0 'flex.messaging.messages.ErrorMessage')
rootCause = (Typed Object #1 'org.jboss.jms.exception.MessagingJMSException')
localizedMessage = "A failure has occurred during processing of the request. Please consult the server logs for more details. SessionEndpoint[d2-6kc80vvf-1-tjq4yuvf-65evyd-z2u2da] createConsumerDelegate [g2-xcd80vvf-1-tjq4yuvf-65evyd-z2u2da]"
linkedException = null
message = "A failure has occurred during processing of the request. Please consult the server logs for more details. SessionEndpoint[d2-6kc80vvf-1-tjq4yuvf-65evyd-z2u2da] createConsumerDelegate [g2-xcd80vvf-1-tjq4yuvf-65evyd-z2u2da]"
cause = null
errorCode = null
destination = "sampleTopic"
headers = (Object #2)
correlationId = null
faultString = "A failure has occurred during processing of the request. Please consult the server logs for more details. SessionEndpoint[d2-6kc80vvf-1-tjq4yuvf-65evyd-z2u2da] createConsumerDelegate [g2-xcd80vvf-1-tjq4yuvf-65evyd-z2u2da]"
messageId = "98CBA488-B70D-9EFE-DB70-8BD2B4C0FD5F"
faultCode = "Server.Processing"
timeToLive = 0.0
extendedData = null
faultDetail = null
clientId = "98C9D309-3C0F-37E1-FA40-5ECAFD17C647"
timestamp = 1.244817555879E12
body = null
As a result, the Consumer in my client happily thinks it's subscribed via LCDS to the JMS topic, when in fact it is not. I've tried attaching event listeners to all the events I could think of (connect, disconnect, channel fault, etc) but none of these is ever fired.
Shouldn't this come back to the client as an error, so it can try additional failover nodes and/or attempt to resubscribe again later?