-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add external compose for clustering (#588)
- Loading branch information
Showing
9 changed files
with
623 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM bellsoft/liberica-openjdk-alpine:13 AS activemq-prod | ||
|
||
LABEL maintainer="Alessio Fabiani <alessio.fabiani@geosolutionsgroup.com>" | ||
|
||
ENV ACTIVEMQ_VERSION 5.17.1 | ||
ENV ACTIVEMQ apache-activemq-$ACTIVEMQ_VERSION | ||
ENV ACTIVEMQ_HOME /opt/activemq/ | ||
ENV ACTIVEMQ_CONF $ACTIVEMQ_HOME/conf/ | ||
ENV ACTIVEMQ_LIB $ACTIVEMQ_HOME/lib/optional/ | ||
|
||
|
||
RUN apk add --update curl && \ | ||
rm -rf /var/cache/apk/* && \ | ||
mkdir -p /opt && \ | ||
curl -s -S https://archive.apache.org/dist/activemq/$ACTIVEMQ_VERSION/$ACTIVEMQ-bin.tar.gz | tar -xvz -C /opt && \ | ||
mv /opt/$ACTIVEMQ $ACTIVEMQ_HOME && \ | ||
addgroup -S activemq && \ | ||
adduser -S -H -G activemq -h $ACTIVEMQ_HOME activemq && \ | ||
chown -R activemq:activemq $ACTIVEMQ_HOME && \ | ||
chown -h activemq:activemq $ACTIVEMQ_HOME | ||
|
||
ADD setup-jars.sh /setup-jars.sh | ||
RUN chmod +x /*.sh;/setup-jars.sh | ||
|
||
COPY activemq.xml $ACTIVEMQ_CONF/activemq.xml | ||
|
||
# EXPOSE 1883 5672 8161 61613 61614 61616 | ||
|
||
USER activemq | ||
WORKDIR $ACTIVEMQ_HOME | ||
|
||
CMD ["/bin/sh", "-c", "bin/activemq console"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless 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 ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<!-- START SNIPPET: example --> | ||
<beans | ||
xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | ||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> | ||
|
||
<!-- Allows us to use system properties as variables in this configuration file --> | ||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> | ||
<property name="locations"> | ||
<value>file:${activemq.conf}/credentials.properties</value> | ||
</property> | ||
</bean> | ||
|
||
<bean id="postgres-ds" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close"> | ||
<property name="dataSourceClassName" value="org.postgresql.ds.PGSimpleDataSource" /> | ||
<property name="maximumPoolSize" value="20" /> | ||
<property name="connectionTimeout" value="30000" /> | ||
<property name="validationTimeout" value="10000" /> | ||
<property name="idleTimeout" value="300000" /> | ||
<property name="connectionInitSql" value="SELECT 1" /> | ||
<property name="connectionTestQuery" value="SELECT 1" /> | ||
<property name="dataSourceProperties" > | ||
<props> | ||
<prop key="portNumber">${POSTGRES_PORT}</prop> | ||
<prop key="databaseName">${POSTGRES_DB}</prop> | ||
<prop key="serverName">${HOST}</prop> | ||
<prop key="user">${POSTGRES_USER}</prop> | ||
<prop key="password">${POSTGRES_PASS}</prop> | ||
<prop key="sslMode">${SSL_MODE}</prop> | ||
<!-- <prop key="sslRootCert">rds.root.cert.url</prop> --> | ||
<prop key="logUnclosedConnections">true</prop> | ||
</props> | ||
</property> | ||
</bean> | ||
|
||
<!-- | ||
The <broker> element is used to configure the ActiveMQ broker. | ||
--> | ||
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" | ||
offlineDurableSubscriberTimeout="300000" offlineDurableSubscriberTaskSchedule="300000"> | ||
|
||
<destinationPolicy> | ||
<policyMap> | ||
<policyEntries> | ||
<policyEntry topic="VirtualTopic.geoserver" expireMessagesPeriod="30"> | ||
<!--The constantPendingMessageLimitStrategy is used to prevent | ||
slow topic consumers to block producers and affect other consumers | ||
by limiting the number of messages that are retained | ||
For more information, see: | ||
http://activemq.apache.org/slow-consumer-handling.html | ||
<pendingMessageLimitStrategy> | ||
<constantPendingMessageLimitStrategy limit="1000"/> | ||
</pendingMessageLimitStrategy> | ||
--> | ||
<!-- | ||
Tell the dead letter strategy not to process expired messages | ||
so that they will just be discarded instead of being sent to | ||
the DLQ | ||
--> | ||
<deadLetterStrategy> | ||
<!-- <sharedDeadLetterStrategy processExpired="false" /> --> | ||
<discarding/> | ||
</deadLetterStrategy> | ||
</policyEntry> | ||
</policyEntries> | ||
</policyMap> | ||
</destinationPolicy> | ||
|
||
<!-- | ||
The managementContext is used to configure how ActiveMQ is exposed in | ||
JMX. By default, ActiveMQ uses the MBean server that is started by | ||
the JVM. For more information, see: | ||
http://activemq.apache.org/jmx.html | ||
--> | ||
<managementContext> | ||
<managementContext createConnector="false"/> | ||
</managementContext> | ||
|
||
<!-- | ||
Configure message persistence for the broker. The default persistence | ||
mechanism is the KahaDB store (identified by the kahaDB tag). | ||
For more information, see: | ||
http://activemq.apache.org/persistence.html | ||
--> | ||
<persistenceAdapter> | ||
<!-- <kahaDB directory="${activemq.data}/kahadb"/> --> | ||
<jdbcPersistenceAdapter dataSource="#postgres-ds" lockKeepAlivePeriod="5000"> | ||
<locker> | ||
<lease-database-locker lockAcquireSleepInterval="10000"/> | ||
</locker> | ||
</jdbcPersistenceAdapter> | ||
</persistenceAdapter> | ||
|
||
<!-- | ||
The systemUsage controls the maximum amount of space the broker will | ||
use before disabling caching and/or slowing down producers. For more information, see: | ||
http://activemq.apache.org/producer-flow-control.html | ||
--> | ||
<systemUsage> | ||
<systemUsage> | ||
<memoryUsage> | ||
<memoryUsage percentOfJvmHeap="70" /> | ||
</memoryUsage> | ||
<storeUsage> | ||
<storeUsage limit="100 gb"/> | ||
</storeUsage> | ||
<tempUsage> | ||
<tempUsage limit="50 gb"/> | ||
</tempUsage> | ||
</systemUsage> | ||
</systemUsage> | ||
|
||
<networkConnectors xmlns="http://activemq.apache.org/schema/core"> | ||
<networkConnector uri="${ACTIVEMQ_SERVER_DISCOVERYURI}" /> | ||
</networkConnectors> | ||
|
||
<!-- | ||
The transport connectors expose ActiveMQ over a given protocol to | ||
clients and other brokers. For more information, see: | ||
http://activemq.apache.org/configuring-transports.html | ||
--> | ||
<transportConnectors> | ||
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --> | ||
<transportConnector name="openwire" uri="${ACTIVEMQ_SERVER_URI}" discoveryUri="${ACTIVEMQ_SERVER_DISCOVERYURI}" /> | ||
<!-- <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> --> | ||
<!-- <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> --> | ||
<!-- <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> --> | ||
<!-- <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> --> | ||
</transportConnectors> | ||
|
||
<!-- destroy the spring context on shutdown to stop jetty --> | ||
<shutdownHooks> | ||
<bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" /> | ||
</shutdownHooks> | ||
|
||
</broker> | ||
|
||
<!-- | ||
Enable web consoles, REST and Ajax APIs and demos | ||
The web consoles requires by default login, you can disable this in the jetty.xml file | ||
Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details | ||
--> | ||
<import resource="jetty.xml"/> | ||
|
||
</beans> | ||
<!-- END SNIPPET: example --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
wget -c --tries=2 https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar \ | ||
-O "${ACTIVEMQ_LIB}"/slf4j-api-1.7.21.jar | ||
wget -c --tries=2 https://repo1.maven.org/maven2/org/postgresql/postgresql/42.4.0/postgresql-42.4.0.jar \ | ||
-O "${ACTIVEMQ_LIB}"/postgresql-42.4.0.jar | ||
wget -c --tries=2 https://repo1.maven.org/maven2/org/osgi/org.osgi.compendium/4.3.1/org.osgi.compendium-4.3.1.jar \ | ||
-O "${ACTIVEMQ_LIB}"/org.osgi.compendium-4.3.1.jar | ||
wget -c --tries=2 https://repo1.maven.org/maven2/org/apache/servicemix/bundles/org.apache.servicemix.bundles.commons-dbcp/1.4_3/org.apache.servicemix.bundles.commons-dbcp-1.4_3-sources.jar \ | ||
-O "${ACTIVEMQ_LIB}"/org.apache.servicemix.bundles.commons-dbcp-1.4_3-sources.jar | ||
wget -c --tries=2 https://repo1.maven.org/maven2/com/zaxxer/HikariCP/2.7.2/HikariCP-2.7.2.jar \ | ||
-O "${ACTIVEMQ_LIB}"/HikariCP-2.7.2.jar |
Oops, something went wrong.