Results 1 to 5 of 5

Thread: Configuring the session timeout on a destination

  1. #1

    Default Configuring the session timeout on a destination

    Hi,

    I'm currently exposing beans as remoting destinations using the @RemotingDestination annotation. I also configured the message broker though the flex:message-broker tag.

    I would like to set the session timeout to 0. I might be wrong, but in the set-up that I used there doesn't seem to be any place where I could specify it. Normally I would have used the properties->network->session-timeout setting available for each destination (e.g. in the remoting-config.xml file)

    Is there any way for me to specify the session-timeout on a destination / on all destinations using the configuration approach that I've taken ?

    Thanks,
    Ionut

  2. #2
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    It is my understanding that in the current version of BlazeDS, the network settings such as "session-timeout" (which I believe is replaced with "subscription-timeout-minutes" in the current version) don't get used by RemotingDestinations, so we have not exposed them in the xml namespace (note that the current BlazeDS docs don't mention the availability of any such settings for RemotingDestinations). Since the FlexSession essentially piggybacks on the HttpSession, setting a timeout of 0 on the HttpSession would probably achieve a similar effect.

    If I am misunderstanding, and you for some reason still have need to apply the session timeout setting, I can direct you to a way to do this using our extension hooks.
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  3. #3

    Default

    Hi Jeremy,

    First of all thanks for your reply.

    Second I failed to mention the fact that I am using Livecycle Data Services 2.6 and not BlazeDS. Sorry for that, I know that I should have mentioned it from the start. In LCDS the session timeout settings are used by the remoting destinations so I would like to set them.

    Could you please give me more details on how I could do this using the extension hooks ?

    Thanks for your help,
    Ionut

  4. #4
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    Quote Originally Posted by ionut.margelatu View Post
    In LCDS the session timeout settings are used by the remoting destinations so I would like to set them.
    Can you point me to some documentation for that? It would be really helpful in determining whether we need to support this explicitly going forward. I was looking here and didn't see anything along those lines:
    http://livedocs.adobe.com/livecycle/...cds/index.html

    For now, what you'll need to do is create and configure a MessageBrokerConfigProcessor that processes the RemotingDestinations and adds the additional configuration programmatically.

    So your MessageBrokerConfigProcessor impl might look something like this:
    Code:
    package com.foo;
    
    import java.util.Iterator;
    
    import org.springframework.flex.config.MessageBrokerConfigProcessor;
    
    import flex.messaging.MessageBroker;
    import flex.messaging.services.RemotingService;
    import flex.messaging.services.remoting.RemotingDestination;
    
    
    public class ApplyRemotingSettingsConfigProcessor implements MessageBrokerConfigProcessor {
    
        public MessageBroker processAfterStartup(MessageBroker broker) {
            RemotingService remotingService = (RemotingService) broker.getServiceByType(RemotingService.class.getName());
            Iterator i = remotingService.getDestinations().values().iterator();
            while (i.hasNext()) {
                RemotingDestination remotingDestination = (RemotingDestination) i.next();            
                remotingDestination.getNetworkSettings().setSubscriptionTimeoutMinutes(0);
            }
            return broker;
        }
    
        public MessageBroker processBeforeStartup(MessageBroker broker) {
            return broker;
        }
    
    }
    You would set up that class as a Spring bean, and then wire it in via the config-processor tag:
    Code:
    <flex:message-broker>
        <flex:config-processor ref="myConfigProcessor"/>
    </flex:message-broker>
    
    <bean id="myConfigProcessor" class="com.foo.ApplyRemotingSettingsConfigProcessor"/>
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  5. #5

    Thumbs up

    Thanks for your answer Jeremy. While I cannot point you to any documentation on the timeout settings for remoting destinations, I have seen them in place in several sample applications and they seemed to work.

    I did as you suggested and written an implementation of MessageBrokerConfigProcessor which sets the subscription timeout to 0. Just to be sure, I also set to 0 the timeout of the HTTP sessions.

    Cheers,
    Ionut

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •