3 Replies Latest reply on Feb 3, 2015 3:30 AM by Claus Ibsen

    How and where to configure maxIdleTime in camel-websocket component?

    Ravi Ramamurthy Newbie

      How and where to configure maxIdleTime for camel-websocket component?

      We are using  JBoss fuse  2.10.0.redhat-60024 version. I want to set the maxIdleTime to never expire like(<=0)

       

      In the document  i can see for Camel 2.12.3we can set maxIdletime like below. but we are in2.10.0.redhat-60024. I tried setting in  jetty.xml. But it's not working.

      maxIdleTime

      null

      Camel 2.12.3: set the time in ms that the websocket created by the websocketServlet may be idle before closing. (default is 300000)

        • 1. Re: How and where to configure maxIdleTime in camel-websocket component?
          Claus Ibsen Master

          Hi

           

          You just configure it in the endpoint uri, eg

           

             from("websocket:xxxxx?maxIdleTime=20000")

          • 2. Re: How and where to configure maxIdleTime in camel-websocket component?
            Ravi Ramamurthy Newbie

            Hi ,

            Thanks for the reply.

            In the documentation it says maxIdleTime parameter supports only in Camel 2.12.3.

            But we are in 2.10.0.redhat-60024 version. When i try like this from("websocket:xxxxx?maxIdleTime=20000") i am getting the below error.

            How to set the maxIdleTime for camel version 2.10.0.redhat-60024 . I don't want any timeout .Connection need to be open for all the time.

             

            JBossFuse:karaf@root> Exception in thread "SpringOsgiExtenderThread-8" org.apache.camel.RuntimeCamelException: org.apach

            e.camel.FailedToCreateRouteException: Failed to create route route556: Route[[From[websocket://ocsws?maxIdleTime=9000]]

            -> [OnExcep... because of Failed to resolve endpoint: websocket://ocsws?maxIdleTime=9000 due to: Failed to resolve endpo

            int: websocket://ocsws?maxIdleTime=9000 due to: There are 1 parameters that couldn't be set on the endpoint. Check the u

            ri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{maxIdleTime=

            9000}]

                    at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1326)

                    at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)

                    at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:283)

                    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMult

            icaster.java:97)

                    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:3

            27)

                    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:

            941)

                    at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundl

            eApplicationContext.java:235)

                    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegated

            ExecutionApplicationContext.java:358)

                    at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)

                    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(Abstrac

            tDelegatedExecutionApplicationContext.java:320)

                    at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$Co

            mpleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)

                    at java.lang.Thread.run(Thread.java:745)

            Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route556: Route[[From[websocket://ocsws

            ?maxIdleTime=9000]] -> [OnExcep... because of Failed to resolve endpoint: websocket://ocsws?maxIdleTime=9000 due to: Fai

            led to resolve endpoint: websocket://ocsws?maxIdleTime=9000 due to: There are 1 parameters that couldn't be set on the e

            ndpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown param

            eters=[{maxIdleTime=9000}]

                    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:177)

                    at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:731)

                    at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1803)

                    at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1589)

                    at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1453)

                    at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)

                    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)

                    at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1421)

                    at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:228)

                    at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)

                    ... 10 more

            Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: websocket://ocsws?maxIdleTime=90

            00 due to: Failed to resolve endpoint: websocket://ocsws?maxIdleTime=9000 due to: There are 1 parameters that couldn't b

            e set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint.

            Unknown parameters=[{maxIdleTime=9000}]

                    at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:488)

                    at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:61)

                    at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:187)

                    at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108)

                    at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114)

                    at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)

                    at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:90)

                    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:857)

                    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:172)

                    ... 19 more

            Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: websocket://ocsws?maxIdleTime=90

            00 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correc

            tly and that they are properties of the endpoint. Unknown parameters=[{maxIdleTime=9000}]

                    at org.apache.camel.impl.DefaultComponent.validateParameters(DefaultComponent.java:148)

                    at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:105)

                    at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:469)

                    ... 27 more

            • 3. Re: How and where to configure maxIdleTime in camel-websocket component?
              Claus Ibsen Master

              Ah yeah that option is not supported in Fuse 6.0. You would need to use 6.1 onwards.

               

              If you have a subscription for Fuse 6.0, you can use the customer portal to ask for this functionality to be backported in a service pack.