Hello,

I'm working on implementing the MESSAGE method in the camel-sip component
[1].

I wanted to add an URI parameter "isSubscribing" which can be true or false
and decides if a consumer will send a subscribing request or not.

I added the boolean value "boolean isSubscribing = false" to the
SipConfiguration class with an @UriParam
annotation [2].

When I run the test [3] with "&isSubscribing=true" in the URI, I get the
following exception:

org.apache.camel.FailedToCreateRouteException: Failed to create route
route2: Route(route2)[[From[sip://johndoe@localhost:5254?stackName=S...
because of Failed to resolve endpoint:
sip://johndoe@localhost:5254?eventHeaderName=evtHdrName&eventId=evtid&isSubscribing=true&stackName=Subscriber&toHost=localhost&toPort=5252&toUser=agent
due to: Failed to resolve endpoint:
sip://johndoe@localhost:5254?eventHeaderName=evtHdrName&eventId=evtid&isSubscribing=true&stackName=Subscriber&toHost=localhost&toPort=5252&toUser=agent
due to: There are 1 parameters that couldn't be set on the endpoint. Check
the uri if the parameters are spelt correctly and that they are properties
of the endpoint. Unknown parameters=[{isSubscribing=true}]

    at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:201)
    at
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:1002)
    at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3374)
    at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3105)
    at
org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:180)
    at
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2934)
    at
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2930)
    at
org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2953)
    at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2930)
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
    at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2897)
    at
org.apache.camel.test.junit4.CamelTestSupport.startCamelContext(CamelTestSupport.java:552)
    at
org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.java:342)
    at
org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:245)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
    at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
    at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
    at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
    at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint:
sip://johndoe@localhost:5254?eventHeaderName=evtHdrName&eventId=evtid&isSubscribing=true&stackName=Subscriber&toHost=localhost&toPort=5252&toUser=agent
due to: Failed to resolve endpoint:
sip://johndoe@localhost:5254?eventHeaderName=evtHdrName&eventId=evtid&isSubscribing=true&stackName=Subscriber&toHost=localhost&toPort=5252&toUser=agent
due to: There are 1 parameters that couldn't be set on the endpoint. Check
the uri if the parameters are spelt correctly and that they are properties
of the endpoint. Unknown parameters=[{isSubscribing=true}]
    at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:616)
    at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:79)
    at
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:211)
    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:69)
    at
org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:90)
    at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1051)
    at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:196)
    ... 45 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint:
sip://johndoe@localhost:5254?eventHeaderName=evtHdrName&eventId=evtid&isSubscribing=true&stackName=Subscriber&toHost=localhost&toPort=5252&toUser=agent
due to: There are 1 parameters that couldn't be set on the endpoint. Check
the uri if the parameters are spelt correctly and that they are properties
of the endpoint. Unknown parameters=[{isSubscribing=true}]
    at
org.apache.camel.impl.DefaultComponent.validateParameters(DefaultComponent.java:181)
    at
org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:126)
    at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:596)
    ... 53 more

Am I doing something wrong in the process of adding an URI value as an
parameter?

Regards,

Nik


[1] = https://issues.apache.org/jira/browse/CAMEL-9190
[2] =
https://github.com/nikvaessen/camel/blob/sip_message/components/camel-sip/src/main/java/org/apache/camel/component/sip/SipConfiguration.java#L196
[3] =
https://github.com/nikvaessen/camel/blob/sip_message/components/camel-sip/src/test/java/org/apache/camel/component/sip/PublishSubscribeTest.java#L62

Reply via email to