artemiscloud / activemq-artemis-operator

Apache License 2.0
66 stars 62 forks source link

Need to update Ingress endpoint url in acceptor #930

Closed gnaveen33 closed 3 weeks ago

gnaveen33 commented 4 months ago

Hi Team,

How to change the default endpoint URL of acceptor to Ingress endpoint URL through Operator?

Regards, Naveen

brusdev commented 4 months ago

@gnaveen33 you can customize the endpoint URL of an acceptor by using broker properties, i.e.

apiVersion: broker.amq.io/v1beta1
kind: ActiveMQArtemis
metadata: 
  name: broker
spec:
  acceptors:
    - name: my-acceptor
      port: 61626
  brokerProperties:
    - 'acceptorConfigurations.my-acceptor.params.host=my-host'

Why do you need to customize the endpoint URL of an acceptor?

gnaveen33 commented 3 months ago

Hi @brusdev ,

While using temporary queues for request response pattern, the observed behaviour is that the consumers are deriving their broker endpoint from the acceptor host. Since the acceptor hosts would not be externally exposed the connections are failing. Do you have any alternative solutions for this?

Changing the endpoint to nginx endpoint with above suggestion did not work, startup of the broker failed with the below error: 2024-06-07 03:31:04,090 ERROR [org.apache.activemq.artemis.core.server] AMQ224000: Failure in initialisation java.lang.IllegalStateException: AMQ229230: Failed to bind acceptor sslacceptor to :61617 at org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor.startServerChannels(NettyAcceptor.java:735) ~[artemis-server-2.31.0.jar:2.31.0] at org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor.start(NettyAcceptor.java:531) ~[artemis-server-2.31.0.jar:2.31.0] at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl.startAcceptors(RemotingServiceImpl.java:316) ~[artemis-server-2.31.0.jar:2.31.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.completeActivation(ActiveMQServerImpl.java:3576) ~[artemis-server-2.31.0.jar:2.31.0] at org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.run(LiveOnlyActivation.java:80) [artemis-server-2.31.0.jar:2.31.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:720) [artemis-server-2.31.0.jar:2.31.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:610) [artemis-server-2.31.0.jar:2.31.0] at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:66) [artemis-cli-2.31.0.jar:2.31.0] at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:130) [artemis-cli-2.31.0.jar:2.31.0] at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:219) [artemis-cli-2.31.0.jar:2.31.0] at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:165) [artemis-cli-2.31.0.jar:2.31.0] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:144) [artemis-boot.jar:2.31.0] at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:61) [artemis-boot.jar:2.31.0] Caused by: io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Cannot assign requested address 2024-06-07 03:31:04,095 INFO [org.apache.activemq.artemis.core.server] AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.31.0 [amq-broker, nodeID=]

brusdev commented 3 months ago

@gnaveen33 if you are using Apache ActiveMQ Artemis CORE client you need to disable topology for load balancing, addinng the following option to the consumer connection url: useTopologyForLoadBalancing=false