Marko Oldenburg b2d45ee0c4
Some checks failed
Build Helm Chart / helm-package (push) Failing after 30s
```
Rename artemis-broker to artemis-broker-primary

This commit renames and refactors the Helm chart for the
artemis-broker. The original files in the artemis-broker
directory are renamed and moved to artemis-broker-primary.
The purpose of this change is to enable a clear
distinction between the primary broker configuration and any
backup or alternative configurations.

Additionally, the configuration has been updated to support
enhancements in TLS setup, metrics services, and users,
allowing for a more robust and flexible deployment.
This change introduces new templates and scripts needed
for managing various aspects of the broker's functions,
including improved user authentication and logging. No
breaking changes were introduced, but users must update
their references to the chart paths as they now point to
the new directory structure.
```
2025-03-18 08:30:01 +01:00

258 lines
17 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--Licensed to the Apache Software Foundation (ASF) under oneor more contributor license agreements. See the NOTICE filedistributed with this work for additional informationregarding copyright ownership. The ASF licenses this fileto you under the Apache License, Version 2.0 (the"License"); you may not use this file except in compliancewith the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing,software distributed under the License is distributed on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANYKIND, either express or implied. See the License for thespecific language governing permissions and limitationsunder the License.-->
<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
<core xmlns="urn:activemq:core" xsi:schemaLocation="urn:activemq:core ">
<name>${AMQ_NAME}</name>
{{- if and .Values.application.persistent (or .Values.clustered .Values.ha_ap) }}
<persistence-enabled>true</persistence-enabled>
<!-- this could be ASYNCIO, MAPPED, NIO ASYNCIO: Linux Libaio MAPPED: mmap files NIO: Plain Java Files -->
<journal-type>{{ .Values.application.journal_type }}</journal-type>
<paging-directory>${AMQ_DATA_DIR}/paging</paging-directory>
<bindings-directory>${AMQ_DATA_DIR}/bindings</bindings-directory>
<journal-directory>${AMQ_DATA_DIR}/journal</journal-directory>
<large-messages-directory>${AMQ_DATA_DIR}/large-messages</large-messages-directory>
{{- else }}
<persistence-enabled>false</persistence-enabled>
<!-- this could be ASYNCIO, MAPPED, NIO ASYNCIO: Linux Libaio MAPPED: mmap files NIO: Plain Java Files -->
<journal-type>NIO</journal-type>
<paging-directory>./data/paging</paging-directory>
<bindings-directory>./data/bindings</bindings-directory>
<journal-directory>./data/journal</journal-directory>
<large-messages-directory>./data/large-messages</large-messages-directory>
{{- end }}
<journal-datasync>true</journal-datasync>
<journal-min-files>2</journal-min-files>
<journal-pool-files>10</journal-pool-files>
<journal-file-size>10M</journal-file-size>
<!-- This value was determined through a calculation. Your system could perform 0.26 writes per millisecond on the current journal configuration. That translates as a sync write every 3800000 nanoseconds. Note: If you specify 0 the system will perform writes directly to the disk. We recommend this to be 0 if you are using journalType=MAPPED and ournal-datasync=false. -->
<journal-buffer-timeout>9524000</journal-buffer-timeout>
<!-- When using ASYNCIO, this will determine the writing queue depth for libaio. -->
<journal-max-io>4096</journal-max-io>
<!-- You can verify the network health of a particular NIC by specifying the <network-check-NIC> element. <network-check-NIC>theNicName</network-check-NIC> -->
<!-- Use this to use an HTTP server to validate the network <network-check-URL-list>http://www.apache.org</network-check-URL-list> -->
<!-- <network-check-period>10000</network-check-period> -->
<!-- <network-check-timeout>1000</network-check-timeout> -->
<!-- this is a comma separated list, no spaces, just DNS or IPs it should accept IPV6 Warning: Make sure you understand your network topology as this is meant to validate if your network is valid. Using IPs that could eventually disappear or be partially visible may defeat the purpose. You can use a list of multiple IPs, and if any successful ping will make the server OK to continue running -->
<!-- <network-check-list>10.0.0.1</network-check-list> -->
<!-- use this to customize the ping used for ipv4 addresses -->
<!-- <network-check-ping-command>ping -c 1 -t %d %s</network-check-ping-command> -->
<!-- use this to customize the ping used for ipv6 addresses -->
<!-- <network-check-ping6-command>ping6 -c 1 %2$s</network-check-ping6-command> -->
<!-- how often we are looking for how many bytes are being used on the disk in ms -->
<disk-scan-period>5000</disk-scan-period>
<!-- once the disk hits this limit the system will block, or close the connection in certain protocols that won't support flow control. -->
<max-disk-usage>90</max-disk-usage>
<!-- should the broker detect dead locks and other issues -->
<critical-analyzer>true</critical-analyzer>
<critical-analyzer-timeout>120000</critical-analyzer-timeout>
<critical-analyzer-check-period>60000</critical-analyzer-check-period>
<critical-analyzer-policy>HALT</critical-analyzer-policy>
<!-- the system will enter into page mode once you hit this limit. This is an estimate in bytes of how much the messages are using in memory The system will use half of the available memory (-Xmx) by default for the global-max-size. You may specify a different value here if you need to customize it to your needs. <global-max-size>${AMQ_STORAGE_USAGE_LIMIT}</global-max-size> -->
<acceptors>
<!-- useEpoll means: it will use Netty epoll if you are on a system (Linux) that supports it -->
<!-- amqpCredits: The number of credits sent to AMQP producers -->
<!-- amqpLowCredits: The server will send the # credits specified at amqpCredits at this low mark -->
<!-- Acceptor for every supported protocol -->
{{- if .Values.parameters.tls_enabled }}
{{- range .Values.service.acceptors }}
{{- $extra_args := list -}}
{{- range .acceptor_params }}
{{- $extra_args = printf "%s=%s" (toString .key) (toString .value) | append $extra_args }}
{{- end }}
{{- if or (.use_tls) (eq (.use_tls | toString) "<nil>") }}
<acceptor name="{{ .name }}">tcp://${BROKER_IP}:{{ .port }}?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols={{ default $.Values.parameters.amq_protocols .amq_protocols }};useEpoll=true;amqpCredits=1000;amqpLowCredits=300;anycastPrefix=${AMQ_ANYCAST_PREFIX};multicastPrefix=${AMQ_MULTICAST_PREFIX};connectionsAllowed={{ .max_connections }};sslEnabled=true;keyStorePath=${AMQ_KEYSTORE_TRUSTSTORE_DIR}/{{ $.Values.tls.keystore }};keyStorePassword=${AMQ_KEYSTORE_PASSWORD};trustStorePath=${AMQ_KEYSTORE_TRUSTSTORE_DIR}/{{ $.Values.tls.truststore }};trustStorePassword=${AMQ_TRUSTSTORE_PASSWORD};sslProvider={{ $.Values.parameters.ssl_provider }};{{ $extra_args | join ";" }}</acceptor>
{{- else }}
<acceptor name="{{ .name }}">tcp://${BROKER_IP}:{{ .port }}?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols={{ default $.Values.parameters.amq_protocols .amq_protocols }};useEpoll=true;amqpCredits=1000;amqpLowCredits=300;anycastPrefix=${AMQ_ANYCAST_PREFIX};multicastPrefix=${AMQ_MULTICAST_PREFIX};{{ $extra_args | join ";" }}</acceptor>
{{- end }}
{{- end }}
{{- else }}
{{- range .Values.service.acceptors }}
{{- $extra_args := list -}}
{{- range .acceptor_params }}
{{- $extra_args = printf "%s=%s" (toString .key) (toString .value) | append $extra_args }}
{{- end }}
<acceptor name="{{ .name }}">tcp://${BROKER_IP}:{{ .port }}?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols={{ default $.Values.parameters.amq_protocols .amq_protocols }};useEpoll=true;amqpCredits=1000;amqpLowCredits=300;anycastPrefix=${AMQ_ANYCAST_PREFIX};multicastPrefix=${AMQ_MULTICAST_PREFIX};{{ $extra_args | join ";" }}</acceptor>
{{- end }}
{{- end }}
</acceptors>
<security-enabled>{{ .Values.security.enabled }}</security-enabled>
<security-settings>
{{- range .Values.queues.addresses }}
<security-setting match="{{ .name }}">
{{- range .permissions }}
<permission type="{{ .grant }}" roles="{{- range $i, $el := .roles }}{{if $i}},{{end}}{{$el}}{{- end -}}" />
{{- end }}
</security-setting>
{{- end }}
<security-setting match="#">
<permission type="createNonDurableQueue" roles="${AMQ_ROLE}" />
<permission type="deleteNonDurableQueue" roles="${AMQ_ROLE}" />
<permission type="createDurableQueue" roles="${AMQ_ROLE}" />
<permission type="deleteDurableQueue" roles="${AMQ_ROLE}" />
<permission type="createAddress" roles="${AMQ_ROLE}" />
<permission type="deleteAddress" roles="${AMQ_ROLE}" />
<permission type="consume" roles="${AMQ_ROLE}" />
<permission type="browse" roles="${AMQ_ROLE}" />
<permission type="send" roles="${AMQ_ROLE}" />
<!-- we need this otherwise ./artemis data imp wouldn't work -->
<permission type="manage" roles="${AMQ_ROLE}" />
</security-setting>
</security-settings>
<address-settings>
<!-- if you define auto-create on certain queues, management has to be auto-create -->
<address-setting match="activemq.management#">
<dead-letter-address>DLQ</dead-letter-address>
<expiry-address>ExpiryQueue</expiry-address>
<redelivery-delay>0</redelivery-delay>
<!-- with -1 only the global-max-size is in use for limiting -->
<max-size-bytes>-1</max-size-bytes>
<message-counter-history-day-limit>10</message-counter-history-day-limit>
<address-full-policy>PAGE</address-full-policy>
</address-setting>
<!--default for catch all-->
<address-setting match="#">
<dead-letter-address>DLQ</dead-letter-address>
<expiry-address>ExpiryQueue</expiry-address>
<max-delivery-attempts>{{ .Values.queues.defaults.maxDeliveryAttempts }}</max-delivery-attempts>
<redelivery-delay>{{ .Values.queues.defaults.redeliveryDelay }}</redelivery-delay>
<redelivery-delay-multiplier>{{ .Values.queues.defaults.redeliveryDelayMultiplier }}</redelivery-delay-multiplier>
<max-redelivery-delay>{{ .Values.queues.defaults.maxRedeliveryDelay }}</max-redelivery-delay>
<!-- with -1 only the global-max-size is in use for limiting -->
<max-size-bytes>{{ .Values.queues.defaults.maxSizeBytes }}</max-size-bytes>
<message-counter-history-day-limit>{{ .Values.queues.defaults.messageCounterHistoryDayLimit }}</message-counter-history-day-limit>
<address-full-policy>{{ .Values.queues.defaults.addressFullPolicy }}</address-full-policy>
{{- if .Values.parameters.amq_force_addresses_cleanup }}
<config-delete-addresses>FORCE</config-delete-addresses>
<config-delete-queues>FORCE</config-delete-queues>
{{- end }}
</address-setting>
{{- range .Values.queues.addresses }}
<address-setting match="{{ .name }}">
{{- if .dlq_address }}
<dead-letter-address>{{ .dlq_address }}</dead-letter-address>
{{- end }}
{{- if .expiry_address }}
<expiry-address>{{ .expiry_address }}</expiry-address>
{{- end }}
<max-delivery-attempts>{{ default $.Values.queues.defaults.maxDeliveryAttempts .maxDeliveryAttempts }}</max-delivery-attempts>
<redelivery-delay>{{ default $.Values.queues.defaults.redeliveryDelay .redeliveryDelay }}</redelivery-delay>
<redelivery-delay-multiplier>{{ default $.Values.queues.defaults.redeliveryDelayMultiplier .redeliveryDelayMultiplier }}</redelivery-delay-multiplier>
<max-redelivery-delay>{{ default $.Values.queues.defaults.maxRedeliveryDelay .maxRedeliveryDelay }}</max-redelivery-delay>
<max-size-bytes>{{ default $.Values.queues.defaults.maxSizeBytes .maxSizeBytes }}</max-size-bytes>
<message-counter-history-day-limit>{{ default $.Values.queues.defaults.messageCounterHistoryDayLimit .messageCounterHistoryDayLimit }}</message-counter-history-day-limit>
<address-full-policy>{{ default $.Values.queues.defaults.addressFullPolicy .addressFullPolicy }}</address-full-policy>
</address-setting>
{{- end }}
</address-settings>
<addresses>
<address name="DLQ">
<anycast>
<queue name="DLQ" />
</anycast>
</address>
<address name="ExpiryQueue">
<anycast>
<queue name="ExpiryQueue" />
</anycast>
</address>
{{- range .Values.queues.addresses }}
<address name="{{ .name }}">
{{- $isMulticast := "" }}
{{- if ( .type ) }}{{- if eq .type "multicast" }}
{{- $isMulticast = print "true" }}
{{- end }}{{- end }}
{{- if $isMulticast }}
<multicast/>
{{- else }}
<anycast>
<queue name="{{ .name }}" />
</anycast>
{{- end }}
</address>
{{- if .dlq_address }}
<address name="{{ .dlq_address }}">
<anycast>
<queue name="{{ .dlq_address }}" />
</anycast>
</address>
{{- end }}
{{- if .expiry_address }}
<address name="{{ .expiry_address }}">
<anycast>
<queue name="{{ .expiry_address }}" />
</anycast>
</address>
{{- end }}
{{- end }}
</addresses>
{{- if .Values.metrics.enabled }}
<metrics>
<jvm-memory>{{ .Values.metrics.jvm_memory }}</jvm-memory>
<jvm-gc>{{ .Values.metrics.jvm_gc }}</jvm-gc>
<jvm-threads>{{ .Values.metrics.jvm_threads }}</jvm-threads>
<plugin class-name="com.redhat.amq.broker.core.server.metrics.plugins.ArtemisPrometheusMetricsPlugin"/>
</metrics>
{{- end }}
{{- if .Values.clustered }}
{{- if .Values.cluster.ha_ap_mode }}
<connectors>
<connector name="{{ .Values.ha_ap.connector.ref }}">tcp://${BROKER_IP}:{{ .Values.ha_ap.connector.port }}</connector>
<connector name="{{ .Values.ha_ap.connector.static.ref }}">tcp://{{ .Values.ha_ap.connector.static.ref }}-svc:{{ .Values.ha_ap.connector.static.port }}</connector>
</connectors>
<cluster-connections>
<cluster-connection name="my-cluster">
<connector-ref>{{ .Values.ha_ap.connector.ref }}</connector-ref>
<static-connectors>
<connector-ref>{{ .Values.ha_ap.connector.static.ref }}</connector-ref>
</static-connectors>
</cluster-connection>
</cluster-connections>
<ha-policy>
<shared-store>
{{- if eq .Values.ha_ap.mode "primary" }}
<primary>
<failover-on-shutdown>true</failover-on-shutdown>
</primary>
{{- else }}
<backup>
<failover-on-shutdown>true</failover-on-shutdown>
</backup>
{{- end }}
</shared-store>
</ha-policy>
{{- else }}
<connectors>
<connector name="{{ .Values.cluster.connector.ref }}">tcp://${BROKER_IP}:{{ .Values.cluster.connector.port }}</connector>
</connectors>
<discovery-groups>
<discovery-group name="my-discovery-group">
<jgroups-file>{{ .Values.cluster.jgroupsCfg }}</jgroups-file>
<jgroups-channel>activemq_broadcast_channel</jgroups-channel>
<refresh-timeout>{{ .Values.cluster.refreshTimeout }}</refresh-timeout>
</discovery-group>
</discovery-groups>
<broadcast-groups>
<broadcast-group name="my-broadcast-group">
<jgroups-file>{{ .Values.cluster.jgroupsCfg }}</jgroups-file>
<jgroups-channel>activemq_broadcast_channel</jgroups-channel>
<connector-ref>{{ .Values.cluster.connector.ref }}</connector-ref>
</broadcast-group>
</broadcast-groups>
<cluster-connections>
<cluster-connection name="my-cluster">
<connector-ref>{{ .Values.cluster.connector.ref }}</connector-ref>
<retry-interval>1000</retry-interval>
<retry-interval-multiplier>2</retry-interval-multiplier>
<max-retry-interval>32000</max-retry-interval>
<initial-connect-attempts>20</initial-connect-attempts>
<reconnect-attempts>10</reconnect-attempts>
<use-duplicate-detection>true</use-duplicate-detection>
<message-load-balancing>ON_DEMAND</message-load-balancing>
<max-hops>1</max-hops>
<discovery-group-ref discovery-group-name="my-discovery-group"/>
</cluster-connection>
</cluster-connections>
{{- end }}
{{- end }}
</core>
</configuration>