Apache flex Tomcat/BlazeDS/ActiveMQ断开连接问题

Apache flex Tomcat/BlazeDS/ActiveMQ断开连接问题,apache-flex,tomcat,jms,activemq,blazeds,Apache Flex,Tomcat,Jms,Activemq,Blazeds,我们在Tomcat/BlazeDS/ActiveMQ堆栈上遇到断开连接的情况。尽管我们的BlazeDS StreamingAMF通道配置了默认的空闲超时分钟数0,但它似乎在大约30分钟的空闲时间后超时(请参阅日志)。客户端在此期间不执行任何请求,我们也不从ActiveMQ主题推送消息 我们已经在activeMQ和BlazeDS上启用了调试日志记录,并看到BlazeDS正在删除使用者。不幸的是,在断开连接消息之前没有日志消息,因此我们无法真正跟踪何时在BlazeDS中调用此消息 有没有其他人经历过

我们在Tomcat/BlazeDS/ActiveMQ堆栈上遇到断开连接的情况。尽管我们的BlazeDS StreamingAMF通道配置了默认的空闲超时分钟数0,但它似乎在大约30分钟的空闲时间后超时(请参阅日志)。客户端在此期间不执行任何请求,我们也不从ActiveMQ主题推送消息

我们已经在activeMQ和BlazeDS上启用了调试日志记录,并看到BlazeDS正在删除使用者。不幸的是,在断开连接消息之前没有日志消息,因此我们无法真正跟踪何时在BlazeDS中调用此消息

有没有其他人经历过这种情况,或者有人能提供解决方案

*ActiveMQ日志*

11 Mar 2009 16:25:47,405 [ActiveMQ Transport: tcp:///127.0.0.1:49971] DEBUG activemq.broker.region.AbstractRegion  - Removing consumer: ID:TMSNEC02.traficon.int-52586-1236783284912-2:3:1:1
11 Mar 2009 16:25:47,406 [ActiveMQ Transport: tcp:///127.0.0.1:49971] DEBUG activemq.broker.region.AbstractRegion  - Removing consumer: ID:TMSNEC02.traficon.int-52586-1236783284912-2:3:-1:1
11 Mar 2009 16:25:47,407 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG activemq.transport.tcp.TcpTransport  - Stopping transport tcp://localhost/127.0.0.1:61616
11 Mar 2009 16:25:47,408 [ActiveMQ Transport Stopper: /127.0.0.1:49971] DEBUG apache.activemq.broker.TransportConnection  - Stopping connection: /127.0.0.1:49971
11 Mar 2009 16:25:47,409 [ActiveMQ Transport Stopper: /127.0.0.1:49971] DEBUG activemq.transport.tcp.TcpTransport  - Stopping transport tcp:///127.0.0.1:49971
11 Mar 2009 16:25:47,413 [ActiveMQ Transport Stopper: /127.0.0.1:49971] DEBUG apache.activemq.broker.TransportConnection  - Stopped connection: /127.0.0.1:49971
11 Mar 2009 16:25:47,417 [ActiveMQ Transport Stopper: /127.0.0.1:49971] DEBUG apache.activemq.broker.TransportConnection  - Connection Stopped: /127.0.0.1:49971
11 Mar 2009 16:25:47,427 [ActiveMQ Transport: tcp:///127.0.0.1:50680] DEBUG activemq.broker.region.AbstractRegion  - Removing consumer: ID:TMSNEC02.traficon.int-52586-1236783284912-2:4:1:1
11 Mar 2009 16:25:47,430 [ActiveMQ Transport: tcp:///127.0.0.1:50680] DEBUG activemq.broker.region.AbstractRegion  - Removing consumer: ID:TMSNEC02.traficon.int-52586-1236783284912-2:4:-1:1
11 Mar 2009 16:25:47,431 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG activemq.transport.tcp.TcpTransport  - Stopping transport tcp://localhost/127.0.0.1:61616
11 Mar 2009 16:25:47,431 [ActiveMQ Transport Stopper: /127.0.0.1:50680] DEBUG apache.activemq.broker.TransportConnection  - Stopping connection: /127.0.0.1:50680
11 Mar 2009 16:25:47,431 [ActiveMQ Transport Stopper: /127.0.0.1:50680] DEBUG activemq.transport.tcp.TcpTransport  - Stopping transport tcp:///127.0.0.1:50680
11 Mar 2009 16:25:47,435 [ActiveMQ Transport Stopper: /127.0.0.1:50680] DEBUG apache.activemq.broker.TransportConnection  - Stopped connection: /127.0.0.1:50680
11 Mar 2009 16:25:47,438 [ActiveMQ Transport Stopper: /127.0.0.1:50680] DEBUG apache.activemq.broker.TransportConnection  - Connection Stopped: /127.0.0.1:50680
11 Mar 2009 16:25:47,439 [ActiveMQ Transport: tcp:///127.0.0.1:50681] DEBUG activemq.broker.region.AbstractRegion  - Removing consumer: ID:TMSNEC02.traficon.int-52586-1236783284912-2:5:1:1
11 Mar 2009 16:25:47,439 [ActiveMQ Transport: tcp:///127.0.0.1:50681] DEBUG activemq.broker.region.AbstractRegion  - Removing consumer: ID:TMSNEC02.traficon.int-52586-1236783284912-2:5:-1:1
11 Mar 2009 16:25:47,440 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG activemq.transport.tcp.TcpTransport  - Stopping transport tcp://localhost/127.0.0.1:61616
11 Mar 2009 16:25:47,440 [ActiveMQ Transport Stopper: /127.0.0.1:50681] DEBUG apache.activemq.broker.TransportConnection  - Stopping connection: /127.0.0.1:50681
11 Mar 2009 16:25:47,441 [ActiveMQ Transport Stopper: /127.0.0.1:50681] DEBUG activemq.transport.tcp.TcpTransport  - Stopping transport tcp:///127.0.0.1:50681
11 Mar 2009 16:25:47,441 [ActiveMQ Transport Stopper: /127.0.0.1:50681] DEBUG apache.activemq.broker.TransportConnection  - Stopped connection: /127.0.0.1:50681
11 Mar 2009 16:25:47,441 [ActiveMQ Transport Stopper: /127.0.0.1:50681] DEBUG apache.activemq.broker.TransportConnection  - Connection Stopped: /127.0.0.1:50681
[BlazeDS]03/11/2009 15:55:39.776 [DEBUG] [Endpoint.AMF] Serializing AMF/HTTP response
Version: 3
  (Message #0 targetURI=/4/onResult, responseURI=)
    (Externalizable Object #0 'DSK')
      (Externalizable Object #1 'flex.messaging.io.ArrayCollection')
        (Array #2)
1.236783339776E12
(Byte Array #3, Length 16)
(Byte Array #4, Length 16)
(Byte Array #5, Length 16)

[BlazeDS]03/11/2009 16:25:47.391 [INFO] [Service.Message.JMS] JMS consumer for JMS destination 'java:comp/env/eventMessagesFlexTopic' is being removed from the JMS adapter
[BlazeDS]03/11/2009 16:25:47.392 [INFO] [Service.Message.JMS] JMS consumer for JMS destination 'java:comp/env/eventMessagesFlexTopic' is stopping.
[BlazeDS]03/11/2009 16:25:47.417 [DEBUG] [Client.MessageClient] MessageClient with clientId '7A98D7BC-F0B3-922C-A968-BE0BFB7D9080' for destination 'eventMessageFeed' has been invalidated.
[BlazeDS]03/11/2009 16:25:47.419 [INFO] [Service.Message.JMS] JMS consumer for JMS destination 'java:comp/env/detectorsFlexTopic' is being removed from the JMS adapter
[BlazeDS]03/11/2009 16:25:47.423 [INFO] [Service.Message.JMS] JMS consumer for JMS destination 'java:comp/env/detectorsFlexTopic' is stopping.
[BlazeDS]03/11/2009 16:25:47.435 [DEBUG] [Client.MessageClient] MessageClient with clientId '7A9BC826-2199-C772-0A1B-FE6FAE9F7402' for destination 'detectorsFeed' has been invalidated.
[BlazeDS]03/11/2009 16:25:47.438 [INFO] [Service.Message.JMS] JMS consumer for JMS destination 'java:comp/env/scenariosFlexTopic' is being removed from the JMS adapter
[BlazeDS]03/11/2009 16:25:47.438 [INFO] [Service.Message.JMS] JMS consumer for JMS destination 'java:comp/env/scenariosFlexTopic' is stopping.
[BlazeDS]03/11/2009 16:25:47.440 [DEBUG] [Client.MessageClient] MessageClient with clientId '7A9BCE40-A0DA-18D6-9FA1-6D6AA2088256' for destination 'scenarioMessageFeed' has been invalidated.
[BlazeDS]03/11/2009 16:25:47.441 [DEBUG] [Client.FlexClient] FlexClient with id '7A95FDE9-0091-B1CD-3660-D8E9CD6CD3E6' has been invalidated.
[BlazeDS]03/11/2009 16:25:47.441 [DEBUG] [Endpoint.StreamingAMF] Endpoint with id 'my-streaming-amf' is streaming message: Flex Message (flex.messaging.messages.CommandMessage)
operation = disconnect
clientId = null
correlationId = null
destination = null
messageId = 7ED1C45A-10A7-BFBB-E24E-94B9C03047EE
timestamp = 1236785147441
timeToLive = 0
body = null
[BlazeDS]03/11/2009 16:25:47.441 [DEBUG] [Endpoint.FlexSession] FlexSession with id '71A76CA22AC435285736F6DB0E38AC11' for an Http-based client connection has been invalidated.
[BlazeDS]03/11/2009 16:25:47.444 [DEBUG] [Client.FlexClient] FlexClient with id '7A941468-80E5-8343-A2AE-A3AFFA135734' has been invalidated.
[BlazeDS]03/11/2009 16:25:47.444 [DEBUG] [Endpoint.FlexSession] FlexSession with id '1238AA40EF8B016F3942C6D6BDBA29B9' for an Http-based client connection has been invalidated.
[BlazeDS]03/11/2009 16:25:47.444 [DEBUG] [Endpoint.StreamingAMF] Streaming thread 'http-8080-1' for endpoint with id 'my-streaming-amf' is releasing connection and returning to the request handler pool.
[BlazeDS]03/11/2009 16:25:47.444 [INFO] [Endpoint.FlexSession] Number of streaming clients for FlexSession with id '71A76CA22AC435285736F6DB0E38AC11' is 0.
[BlazeDS]03/11/2009 16:25:47.444 [DEBUG] [Endpoint.StreamingAMF] Number of streaming clients for endpoint with id 'my-streaming-amf' is 0.
[BlazeDS]03/11/2009 16:25:47.489 [DEBUG] [Endpoint.FlexSession] FlexSession created with id 'E5BCC7617F3937139CCAD377EEB85D45' for an Http-based client connection.
[BlazeDS]03/11/2009 16:25:47.489 [INFO] [Endpoint.General] Channel endpoint my-streaming-amf received request.
*BlazeDS日志*

11 Mar 2009 16:25:47,405 [ActiveMQ Transport: tcp:///127.0.0.1:49971] DEBUG activemq.broker.region.AbstractRegion  - Removing consumer: ID:TMSNEC02.traficon.int-52586-1236783284912-2:3:1:1
11 Mar 2009 16:25:47,406 [ActiveMQ Transport: tcp:///127.0.0.1:49971] DEBUG activemq.broker.region.AbstractRegion  - Removing consumer: ID:TMSNEC02.traficon.int-52586-1236783284912-2:3:-1:1
11 Mar 2009 16:25:47,407 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG activemq.transport.tcp.TcpTransport  - Stopping transport tcp://localhost/127.0.0.1:61616
11 Mar 2009 16:25:47,408 [ActiveMQ Transport Stopper: /127.0.0.1:49971] DEBUG apache.activemq.broker.TransportConnection  - Stopping connection: /127.0.0.1:49971
11 Mar 2009 16:25:47,409 [ActiveMQ Transport Stopper: /127.0.0.1:49971] DEBUG activemq.transport.tcp.TcpTransport  - Stopping transport tcp:///127.0.0.1:49971
11 Mar 2009 16:25:47,413 [ActiveMQ Transport Stopper: /127.0.0.1:49971] DEBUG apache.activemq.broker.TransportConnection  - Stopped connection: /127.0.0.1:49971
11 Mar 2009 16:25:47,417 [ActiveMQ Transport Stopper: /127.0.0.1:49971] DEBUG apache.activemq.broker.TransportConnection  - Connection Stopped: /127.0.0.1:49971
11 Mar 2009 16:25:47,427 [ActiveMQ Transport: tcp:///127.0.0.1:50680] DEBUG activemq.broker.region.AbstractRegion  - Removing consumer: ID:TMSNEC02.traficon.int-52586-1236783284912-2:4:1:1
11 Mar 2009 16:25:47,430 [ActiveMQ Transport: tcp:///127.0.0.1:50680] DEBUG activemq.broker.region.AbstractRegion  - Removing consumer: ID:TMSNEC02.traficon.int-52586-1236783284912-2:4:-1:1
11 Mar 2009 16:25:47,431 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG activemq.transport.tcp.TcpTransport  - Stopping transport tcp://localhost/127.0.0.1:61616
11 Mar 2009 16:25:47,431 [ActiveMQ Transport Stopper: /127.0.0.1:50680] DEBUG apache.activemq.broker.TransportConnection  - Stopping connection: /127.0.0.1:50680
11 Mar 2009 16:25:47,431 [ActiveMQ Transport Stopper: /127.0.0.1:50680] DEBUG activemq.transport.tcp.TcpTransport  - Stopping transport tcp:///127.0.0.1:50680
11 Mar 2009 16:25:47,435 [ActiveMQ Transport Stopper: /127.0.0.1:50680] DEBUG apache.activemq.broker.TransportConnection  - Stopped connection: /127.0.0.1:50680
11 Mar 2009 16:25:47,438 [ActiveMQ Transport Stopper: /127.0.0.1:50680] DEBUG apache.activemq.broker.TransportConnection  - Connection Stopped: /127.0.0.1:50680
11 Mar 2009 16:25:47,439 [ActiveMQ Transport: tcp:///127.0.0.1:50681] DEBUG activemq.broker.region.AbstractRegion  - Removing consumer: ID:TMSNEC02.traficon.int-52586-1236783284912-2:5:1:1
11 Mar 2009 16:25:47,439 [ActiveMQ Transport: tcp:///127.0.0.1:50681] DEBUG activemq.broker.region.AbstractRegion  - Removing consumer: ID:TMSNEC02.traficon.int-52586-1236783284912-2:5:-1:1
11 Mar 2009 16:25:47,440 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG activemq.transport.tcp.TcpTransport  - Stopping transport tcp://localhost/127.0.0.1:61616
11 Mar 2009 16:25:47,440 [ActiveMQ Transport Stopper: /127.0.0.1:50681] DEBUG apache.activemq.broker.TransportConnection  - Stopping connection: /127.0.0.1:50681
11 Mar 2009 16:25:47,441 [ActiveMQ Transport Stopper: /127.0.0.1:50681] DEBUG activemq.transport.tcp.TcpTransport  - Stopping transport tcp:///127.0.0.1:50681
11 Mar 2009 16:25:47,441 [ActiveMQ Transport Stopper: /127.0.0.1:50681] DEBUG apache.activemq.broker.TransportConnection  - Stopped connection: /127.0.0.1:50681
11 Mar 2009 16:25:47,441 [ActiveMQ Transport Stopper: /127.0.0.1:50681] DEBUG apache.activemq.broker.TransportConnection  - Connection Stopped: /127.0.0.1:50681
[BlazeDS]03/11/2009 15:55:39.776 [DEBUG] [Endpoint.AMF] Serializing AMF/HTTP response
Version: 3
  (Message #0 targetURI=/4/onResult, responseURI=)
    (Externalizable Object #0 'DSK')
      (Externalizable Object #1 'flex.messaging.io.ArrayCollection')
        (Array #2)
1.236783339776E12
(Byte Array #3, Length 16)
(Byte Array #4, Length 16)
(Byte Array #5, Length 16)

[BlazeDS]03/11/2009 16:25:47.391 [INFO] [Service.Message.JMS] JMS consumer for JMS destination 'java:comp/env/eventMessagesFlexTopic' is being removed from the JMS adapter
[BlazeDS]03/11/2009 16:25:47.392 [INFO] [Service.Message.JMS] JMS consumer for JMS destination 'java:comp/env/eventMessagesFlexTopic' is stopping.
[BlazeDS]03/11/2009 16:25:47.417 [DEBUG] [Client.MessageClient] MessageClient with clientId '7A98D7BC-F0B3-922C-A968-BE0BFB7D9080' for destination 'eventMessageFeed' has been invalidated.
[BlazeDS]03/11/2009 16:25:47.419 [INFO] [Service.Message.JMS] JMS consumer for JMS destination 'java:comp/env/detectorsFlexTopic' is being removed from the JMS adapter
[BlazeDS]03/11/2009 16:25:47.423 [INFO] [Service.Message.JMS] JMS consumer for JMS destination 'java:comp/env/detectorsFlexTopic' is stopping.
[BlazeDS]03/11/2009 16:25:47.435 [DEBUG] [Client.MessageClient] MessageClient with clientId '7A9BC826-2199-C772-0A1B-FE6FAE9F7402' for destination 'detectorsFeed' has been invalidated.
[BlazeDS]03/11/2009 16:25:47.438 [INFO] [Service.Message.JMS] JMS consumer for JMS destination 'java:comp/env/scenariosFlexTopic' is being removed from the JMS adapter
[BlazeDS]03/11/2009 16:25:47.438 [INFO] [Service.Message.JMS] JMS consumer for JMS destination 'java:comp/env/scenariosFlexTopic' is stopping.
[BlazeDS]03/11/2009 16:25:47.440 [DEBUG] [Client.MessageClient] MessageClient with clientId '7A9BCE40-A0DA-18D6-9FA1-6D6AA2088256' for destination 'scenarioMessageFeed' has been invalidated.
[BlazeDS]03/11/2009 16:25:47.441 [DEBUG] [Client.FlexClient] FlexClient with id '7A95FDE9-0091-B1CD-3660-D8E9CD6CD3E6' has been invalidated.
[BlazeDS]03/11/2009 16:25:47.441 [DEBUG] [Endpoint.StreamingAMF] Endpoint with id 'my-streaming-amf' is streaming message: Flex Message (flex.messaging.messages.CommandMessage)
operation = disconnect
clientId = null
correlationId = null
destination = null
messageId = 7ED1C45A-10A7-BFBB-E24E-94B9C03047EE
timestamp = 1236785147441
timeToLive = 0
body = null
[BlazeDS]03/11/2009 16:25:47.441 [DEBUG] [Endpoint.FlexSession] FlexSession with id '71A76CA22AC435285736F6DB0E38AC11' for an Http-based client connection has been invalidated.
[BlazeDS]03/11/2009 16:25:47.444 [DEBUG] [Client.FlexClient] FlexClient with id '7A941468-80E5-8343-A2AE-A3AFFA135734' has been invalidated.
[BlazeDS]03/11/2009 16:25:47.444 [DEBUG] [Endpoint.FlexSession] FlexSession with id '1238AA40EF8B016F3942C6D6BDBA29B9' for an Http-based client connection has been invalidated.
[BlazeDS]03/11/2009 16:25:47.444 [DEBUG] [Endpoint.StreamingAMF] Streaming thread 'http-8080-1' for endpoint with id 'my-streaming-amf' is releasing connection and returning to the request handler pool.
[BlazeDS]03/11/2009 16:25:47.444 [INFO] [Endpoint.FlexSession] Number of streaming clients for FlexSession with id '71A76CA22AC435285736F6DB0E38AC11' is 0.
[BlazeDS]03/11/2009 16:25:47.444 [DEBUG] [Endpoint.StreamingAMF] Number of streaming clients for endpoint with id 'my-streaming-amf' is 0.
[BlazeDS]03/11/2009 16:25:47.489 [DEBUG] [Endpoint.FlexSession] FlexSession created with id 'E5BCC7617F3937139CCAD377EEB85D45' for an Http-based client connection.
[BlazeDS]03/11/2009 16:25:47.489 [INFO] [Endpoint.General] Channel endpoint my-streaming-amf received request.

如果需要,您可以响应断开连接事件并重新连接。

我们通过每30秒从客户端向服务器发送一条保持活动消息来解决此问题。显然是FlexSession超时,因为这是Tomcat的默认会话超时。由于keep-alive消息以较低的时间间隔发送,因此我们还将服务器上的会话超时设置为较低的值,从而提高了服务器上的内存消耗

感谢您的帮助…它刚刚帮助我解决了我自己的FlexSession过期问题!