Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-6844

Add PollingConsumerPollStrategy option to AMQPComponent

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • camel-amqp
    • None
    • Unknown

    Description

      I try to use my custom PollingConsumerPollStrategy for AMQPComponent endpoint, but my enpoint can't be created. Answer from Claus Ibsen on the forum was "That option is not supported on amqpcomponent" (http://camel.465427.n5.nabble.com/PollingConsumerPollStrategy-for-AMQPComponent-endpoint-td5740198.html)

      = Exception =

      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: amqp:queue:broadcast.MY_QUEUE?pollStrategy=%23MyPollingConsumerPollStrategy 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=[

      {pollStrategy=#MyPollingConsumerPollStrategy}

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

      = In my RouteBuilder =

      JndiRegistry registry = (JndiRegistry) ((PropertyPlaceholderDelegateRegistry) getContext().getRegistry()).getRegistry();

      registry.bind(LoaderPollingConsumerPollStrategy.class.getSimpleName(), new MyPollingConsumerPollStrategy());

      (AMQPComponent) AMQPComponent.amqpComponent("My AMQP broker URI");

      Endpoint amqpEndpoint = this.amqpComponent.createEndpoint("amqp:queue:broadcast.MY_QUEUE?pollStrategy=#MyPollingConsumerPollStrategy"); // ResolveEndpointFailedException here

      Attachments

        Activity

          People

            Unassigned Unassigned
            magner58 Dmytro Puzhay
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: