artemiscloud / activemq-artemis-operator

Apache License 2.0
64 stars 62 forks source link

Disable auto creation of addresses prevents address & queue creation via the Operator #45

Closed mhofstetter closed 1 year ago

mhofstetter commented 3 years ago

Describe the bug Disable auto creation of addresses via the address settings prevents address & queue creation via the Operators CRD.

To Reproduce Steps to reproduce the behavior:

  1. Create an ActiveMQArtemis with the following addresssettings
apiVersion: broker.amq.io/v2alpha4
kind: ActiveMQArtemis
metadata:
  name: ex-aao
spec:
  deploymentPlan:
    size: 1
    image: quay.io/artemiscloud/activemq-artemis-broker-kubernetes:0.2.0
    persistenceEnabled: false
  addressSettings:
    addressSetting:
      - autoCreateAddresses: false
        match: '#'
    applyRule: merge_all
  1. Try to create the following Address
apiVersion: broker.amq.io/v2alpha2
kind: ActiveMQArtemisAddress
metadata:
  name: ex-aaoaddress
spec:
  addressName: myAddress0
  queueName: myQueue0
  routingType: anycast
  1. The address & queue doesn't get created.

Under the hood the creation fails with the following error

java.lang.IllegalStateException : AMQ229203: Address Does Not Exist: myAddress0

The error doesn't get logged because of wrong error handling - see https://github.com/artemiscloud/activemq-artemis-management/issues/3

The error message can be reproduced when trying to create the queue via the Jolokia / JMX Operation in the hawt.io console.

Platform (please complete the following information):

Expected behavior The Operator should provide the possibility to create Addresses and Queues even though the auto creation (for consuming applications) is disabled. Therefore, it might be better to be able to define an Address and a Queue (which references an Address) in its own CRD instead of using the CRD 'ActiveMQArtemisAddress' for both of them (actually it's only for creating a Queue)

Additional context The goal is to be able to disable all the auto creation features of ActiveMQ Artemis (Addresses & Queues) and explicitly define them via the operator.

gaohoward commented 3 years ago

yes it lacks such flexibility for the moment.

gaohoward commented 3 years ago

If you are using the latest release 0.20.0, you can first create the address by specifying only the address in the CR, then deploy another CR with queue/address in it.

brusdev commented 1 year ago

@mhofstetter are you able to reproduce this issue using the latest version of the operator?

mhofstetter commented 1 year ago

@brusdev seems to be fixed with the latest version. address & queue are getting created after applying the CR :+1:

brusdev commented 1 year ago

@mhofstetter thanks for your feedback.