Skip to content

Commit

Permalink
QPID-8352: [Broker-J] Official Docker image for Broker-J
Browse files Browse the repository at this point in the history
  • Loading branch information
dakirily committed Oct 31, 2023
1 parent aae8383 commit 129e7eb
Show file tree
Hide file tree
Showing 24 changed files with 560 additions and 269 deletions.
122 changes: 12 additions & 110 deletions doc/java-broker/src/docbkx/Java-Broker-Docker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,12 @@

<title>Docker Images Types</title>

<para>Broker currently supports 4 types of storages:
<itemizedlist>
<listitem><para><emphasis>BDB</emphasis></para></listitem>
<listitem><para><emphasis>Derby</emphasis></para></listitem>
<listitem><para><emphasis>JDBC</emphasis></para></listitem>
<listitem><para><emphasis>Memory</emphasis></para></listitem>
</itemizedlist>
</para>

<para>
Broker storage type "Memory" don't provide persistent storage (all messages are kept in memory),
meaning that after container restart all the messages as well as the created broker objects will be gone.
By default broker images is built with BDB message storage.
</para>

<para>Container image has the following structure:</para>
<para>qpid-broker-j-&lt;OS_NAME>-&lt;JRE_VERSION>-&lt;STORAGE_TYPE>-&lt;AMQP_VERSION></para>
<para>qpid-broker-j-&lt;OS_NAME></para>
<para><emphasis>OS_NAME</emphasis> can have values: alpine, centos7, ubi9, ubuntu</para>
<para><emphasis>JRE_VERSION</emphasis> can have values: 11, 17, 21</para>
<para><emphasis>STORAGE_TYPE</emphasis> can have values: bdb, derby, memory, postgres</para>
Expand All @@ -59,60 +49,7 @@
<title>Container Start</title>

<para>
Container can be started using following command:
</para>

<para>
<programlisting>
docker run -d -p 5672:5672 -p 8080:8080 --name qpid-broker-j &lt;IMAGE_NAME>
</programlisting>
</para>

<para>
There are two ports exposed: 5672 for AMQP connections and 8080 for HTTP connections.
</para>

<para>
There are following environment variables available when running the container:
</para>

<table>
<title>Environment Variables</title>
<tgroup cols="2">
<colspec colnum="1" colname="variable" colwidth="1*"/>
<colspec colnum="2" colname="description" colwidth="1*"/>
<thead>
<row>
<entry>Environment Variable</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>JAVA_GC</entry>
<entry>JVM Garbage Collector parameters, default value "-XX:+UseG1GC"</entry>
</row>
<row>
<entry>JAVA_MEM</entry>
<entry>JVM memory parameters, default value "-Xmx300m -XX:MaxDirectMemorySize=200m"</entry>
</row>
<row>
<entry>JAVA_OPTS</entry>
<entry>Further JVM parameters, default value for memory storage "-Dqpid.tests.mms.messagestore.persistence=true", for other storage types default value is an empty string</entry>
</row>
</tbody>
</tgroup>
</table>

</section>

<section xml:id="Java-Broker-Docker-Persistent-Volume">

<title>Persistent Volume</title>

<para>
When using Memory broker storage, all broker configuration and messages are stored in memory and are lost with the
container restart. When using BDB or Derby broker storage, before starting the container a volume should be created:
Before starting the container a volume should be created:
</para>

<para>
Expand Down Expand Up @@ -142,22 +79,15 @@
</para>

<para>
In such way both broker configuration files and messages will be persisted in container volume and will survive
the container restart.
There are two ports exposed: 5672 for AMQP connections and 8080 for HTTP connections.
</para>

</section>

<section xml:id="Java-Broker-Docker-Database-Connection">

<title>Database Connection</title>

<para>
Following environment variables can be used to configure database connection:
There are following environment variables available when running the container:
</para>

<table>
<title>Database Connection Environment Variables</title>
<title>Environment Variables</title>
<tgroup cols="2">
<colspec colnum="1" colname="variable" colwidth="1*"/>
<colspec colnum="2" colname="description" colwidth="1*"/>
Expand All @@ -169,49 +99,21 @@
</thead>
<tbody>
<row>
<entry>DB_HOSTNAME</entry>
<entry>Database hostname</entry>
</row>
<row>
<entry>DB_PORT</entry>
<entry>Database port</entry>
</row>
<row>
<entry>DB_NAME</entry>
<entry>Database name</entry>
<entry>JAVA_GC</entry>
<entry>JVM Garbage Collector parameters, default value "-XX:+UseG1GC"</entry>
</row>
<row>
<entry>DB_USERNAME</entry>
<entry>Database username</entry>
<entry>JAVA_MEM</entry>
<entry>JVM memory parameters, default value "-Xmx300m -XX:MaxDirectMemorySize=200m"</entry>
</row>
<row>
<entry>DB_PASSWORD</entry>
<entry>Database password</entry>
<entry>JAVA_OPTS</entry>
<entry>Further JVM parameters, default value is an empty string</entry>
</row>
</tbody>
</tgroup>
</table>

<para>
Example:
</para>

<para>
<programlisting>
docker volume create --driver local --opt device=&lt;PATH_TO_FOLDER> --opt type=none --opt o=bind qpid_volume
</programlisting>
</para>
<para>
<programlisting>
docker run -d -p 5672:5672 -p 8080:8080 -v qpid_volume:/qpid-broker-j/work --name qpid -e DB_HOSTNAME=127.0.0.1 -e DB_PORT=5432 -e DB_NAME=qpid -e DB_USERNAME=qpid -e DB_PASSWORD=admin &lt;IMAGE_NAME>
</programlisting>
</para>

<para>
In this case broker configuration files are persisted in the volume "qpid_volume" and messages are stored in database
configured by the appropriate environment variables.
</para>

</section>

</section>
Expand Down
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@

<bdb-version>7.4.5</bdb-version>
<derby-version>10.14.2.0</derby-version>
<postgres-version>42.6.0</postgres-version>
<logback-version>1.4.11</logback-version>
<logback-db-version>1.2.11.1</logback-db-version>
<guava-version>32.1.2-jre</guava-version>
Expand Down Expand Up @@ -559,11 +558,6 @@
<artifactId>derby</artifactId>
<version>${derby-version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres-version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
Expand Down Expand Up @@ -1697,7 +1691,7 @@
<licenseMerges>
<licenseMerge>Apache Software License, Version 2.0|The Apache Software License, Version 2.0|Apache Software License - Version 2.0|Apache v2|Apache 2|Apache License, Version 2.0|Apache 2.0|Apache Public License 2.0|Apache License, version 2.0|Apache License 2.0|The Apache License, Version 2.0|Apache 2.0 License|Apache-2.0</licenseMerge>
<licenseMerge>The MIT License|MIT License|MIT license</licenseMerge>
<licenseMerge>BSD License|New BSD|New BSD License|BSD 3-Clause|BSD-3-Clause|BSD Licence 3|BSD License 3|The BSD License|BSD-2-Clause</licenseMerge>
<licenseMerge>BSD License|New BSD|New BSD License|BSD 3-Clause|BSD-3-Clause|BSD Licence 3|BSD License 3|The BSD License</licenseMerge>
<licenseMerge>Eclipse Public License - Version 1.0|Eclipse Public License - v 1.0|Eclipse Public License, Version 1.0|Eclipse Public License 1.0|MPL 2.0 or EPL 1.0</licenseMerge>
<licenseMerge>Eclipse Public License - Version 2.0|Eclipse Public License - v 2.0|Eclipse Public License, Version 2.0|Eclipse Public License 2.0|Eclipse Public License v2.0|MPL 2.0 or EPL 2.0|EPL 2.0</licenseMerge>
<licenseMerge>Academic Free License v2.1|AFL-2.1</licenseMerge>
Expand Down
Loading

0 comments on commit 129e7eb

Please sign in to comment.