spring cloud stream

Options
akg17
akg17 Member Posts: 76

cloud:
stream:
bindings:
inbound:
destination: TestQueue
group: perf
concurrency: 2

I get 403 Permission Not allowed whenever i add a group name what is causing issue ?

TcpClientChannel : Error Response (403) - Permission Not Allowed - Queue

Comments

  • akg17
    akg17 Member Posts: 76
    Options

    org.springframework.cloud.stream.binder.BinderException: Exception thrown while starting consumer:
    at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:462) ~[spring-cloud-stream-3.1.2.jar:3.1.2]
    at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:91) ~[spring-cloud-stream-3.1.2.jar:3.1.2]
    at org.springframework.cloud.stream.binder.AbstractBinder.bindConsumer(AbstractBinder.java:143) ~[spring-cloud-stream-3.1.2.jar:3.1.2]
    at org.springframework.cloud.stream.binding.BindingService.lambda$rescheduleConsumerBinding$1(BindingService.java:201) ~[spring-cloud-stream-3.1.2.jar:3.1.2]
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.3.6.jar:5.3.6]
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
    at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
    Caused by: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'TestQueue.perf.errors.recoverer' defined in null: Cannot register bean definition [Root bean: class [org.springframework.integration.handler.advice.ErrorMessageSendingRecoverer]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] for bean 'TestQueue.perf.errors.recoverer': There is already [Root bean: class [org.springframework.integration.handler.advice.ErrorMessageSendingRecoverer]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] bound.
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.registerBeanDefinition(DefaultListableBeanFactory.java:995) ~[spring-beans-5.3.6.jar:5.3.6]
    at org.springframework.context.support.GenericApplicationContext.registerBeanDefinition(GenericApplicationContext.java:330) ~[spring-context-5.3.6.jar:5.3.6]
    at org.springframework.context.support.GenericApplicationContext.registerBean(GenericApplicationContext.java:478) ~[spring-context-5.3.6.jar:5.3.6]
    at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.registerErrorInfrastructure(AbstractMessageChannelBinder.java:687) ~[spring-cloud-stream-3.1.2.jar:3.1.2]
    at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.registerErrorInfrastructure(AbstractMessageChannelBinder.java:639) ~[spring-cloud-stream-3.1.2.jar:3.1.2]
    at com.solace.spring.cloud.stream.binder.SolaceMessageChannelBinder.createConsumerEndpoint(SolaceMessageChannelBinder.java:108) ~[spring-cloud-stream-binder-solace-3.0.0.jar:na]
    at com.solace.spring.cloud.stream.binder.SolaceMessageChannelBinder.createConsumerEndpoint(SolaceMessageChannelBinder.java:40) ~[spring-cloud-stream-binder-solace-3.0.0.jar:na]
    at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:408) ~[spring-cloud-stream-3.1.2.jar:3.1.2]
    ... 10 common frames omitted

    2

  • uherbst
    uherbst Member, Employee Posts: 121 Solace Employee
    Options

    Queues in a Solace broker have two levels of permissions.
    Level 1 is "owner". The owner can do everything with messages in the queue.
    Level 2 is "all other". The permission can be "none", "consume" (and some more).

    To fix your issue, you either have to make the client-username you use in your connection as the owner of the queue or change the "all other" permission to consume.

  • akg17
    akg17 Member Posts: 76
    edited July 2021 #4
    Options

    Without group name its subscribing but with group name it throws exception from the broker side things are restricted application cant not use auto creation of anything we pre provision, there is this bean throwing exception
    Invalid bean definition with name 'TestQueue.perf.errors.recoverer', This seems to be dmq but how to disable it because anyway we cant use it in heiger region ,

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 923 admin
    edited July 2021 #5
    Options

    Hi @akg17,

    This is likely how the Solace Binder handles the different communication models defined in Spring Cloud Stream. I wrote a lot more detail in section 3 of the Spring Cloud Stream - Beyond the Basics codelab but to get straight to the point here:

    When you use a "group" with Spring Cloud Stream you are saying to follow the Consumer Group pattern. The Solace binder does this by creating a non-exclusive durable queue endpoint that subscribes to the topics requested.

    When you do not include a group the Solace binder is creating a non-durable queue with the proper topic subscriptions.

    Given the info above and your error my guess is that your client-profile does not have permissions to create a durable endpoint. You can check that in PubSub+ Manager.