activemq-p2p

Description

    Requirements

    Install ActiveMQ on Docker

    docker-compose:

    version: '3'
    services:
      activemq:
        image: rmohr/activemq
        ports:
          - "61616:61616"
          - "8161:8161"
        volumes:
          - data:/data
          - conf:/conf
    volumes:
      data:
      conf:

    Project Structure

    pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    	<modelVersion>4.0.0</modelVersion>
    
    	<groupId>com.jreact</groupId>
    	<artifactId>activemq-p2p</artifactId>
    	<version>0.0.1-SNAPSHOT</version>
    	<name>activemq-p2p</name>
    	<description>activemq-p2p test project</description>
    
    	<properties>
    		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    	</properties>
    
    	<dependencies>
    		<dependency>
    			<groupId>org.apache.activemq</groupId>
    			<artifactId>activemq-core</artifactId>
    			<version>5.7.0</version>
    		</dependency>
    		<dependency>
    			<groupId>org.slf4j</groupId>
    			<artifactId>slf4j-api</artifactId>
    			<version>2.0.0-alpha6</version>
    		</dependency>
    		<dependency>
    			<groupId>org.slf4j</groupId>
    			<artifactId>slf4j-simple</artifactId>
    			<version>2.0.0-alpha6</version>
    		</dependency>
    	</dependencies>
    
    	<build>
    		<defaultGoal>install</defaultGoal>
    		<finalName>activemq</finalName>
    		<plugins>
    			<plugin>
    				<groupId>org.apache.maven.plugins</groupId>
    				<artifactId>maven-compiler-plugin</artifactId>
    				<version>2.5.1</version>
    				<inherited>true</inherited>
    				<configuration>
    					<source>17</source>
    					<target>17</target>
    				</configuration>
    			</plugin>
    		</plugins>
    	</build>
    </project>

    Testing Producer

    Run ProducerMain.java

    Testing Consumer

    Run ConsumerMain.java

    AUTO_ACKNOWLEDGE

    – in SimpleQueue.java

    Acknowledgment modes

    Mark