Berichtenmakelaar (ActiveMQ Artemis)
Adobe Commerce ondersteunt ook de open-source berichtbroker van ActiveMQ Artemis via het Simple Text Oriented Messaging Protocol (STOMP). Het levert een betrouwbaar en scalable overseinensysteem, dat flexibiliteit voor op STOMP-Gebaseerde integratie biedt.
De rijen van het bericht verstrekken een asynchroon communicatie mechanisme waarin de afzender en de ontvanger van een bericht niet elkaar contacteren. Noch moeten zij met de berichtrij tezelfdertijd communiceren. Wanneer een afzender een bericht in een rij plaatst, wordt het opgeslagen tot de ontvanger hen ontvangt.
Het systeem van de berichtrij moet worden gevestigd alvorens u Adobe Commerce installeert. De basisvolgorde is:
- Installeer Apache ActiveMQ Artemis en alle voorwaarden.
- ActiveMQ verbinden met Adobe Commerce.
Apache ActiveMQ Artemis installeren
U kunt ActiveMQ-artemis installeren met Docker (aanbevolen voor ontwikkeling) of met de hand (aanbevolen voor productie).
Optie 1: Docker-installatie (aanbevolen voor ontwikkeling)
Vereisten
Controleer of Docker op uw systeem is geïnstalleerd en wordt uitgevoerd.
Installatiestappen
-
Voer ActiveMQ-artemis uit met de officiële Docker-afbeelding:
code language-bash # Run with default configuration docker run --detach \ --name artemis \ --publish 8161:8161 \ --publish 61613:61613 \ --publish 5672:5672 \ apache/activemq-artemis:2.42.0 -
Uitvoeren met aangepaste referenties:
code language-bash # Run with custom username/password docker run --detach \ --name artemis \ --publish 8161:8161 \ --publish 61613:61613 \ --publish 5672:5672 \ --env ARTEMIS_USER=magento \ --env ARTEMIS_PASSWORD=magento \ apache/activemq-artemis:2.42.0
Opdrachten voor Docker-beheer
# Check container status
docker ps | grep artemis
# View logs
docker logs artemis
# Stop the container
docker stop artemis
# Start the container
docker start artemis
# Remove the container
docker rm artemis
Toegang tot diensten
Zodra de container van de Dokker loopt, kunt u tot:
- console van het Web: http://localhost :8161/console (standaardgeloofsbrieven: artemis/artemis)
- STOMP haven: localhost :61613 (voor de verbinding van Adobe Commerce)
Optie 2: Handmatige installatie op Ubuntu/CentOS
Vereisten
Controleer of Java 17 of hoger is geïnstalleerd (vereist voor ActiveMQ Artemis 2.42.0+).
Installatiestappen
-
Download en installeer de recentste versie van de Apache ActiveMQ Artemis website . Vanaf september 2025 is de meest recente stabiele versie 2.42.0:
code language-bash sudo mkdir -p /opt/artemis cd /opt/artemis sudo curl -O https://downloads.apache.org/activemq/activemq-artemis/2.42.0/apache-artemis-2.42.0-bin.tar.gz sudo tar -xzf apache-artemis-2.42.0-bin.tar.gz --strip-components=1 sudo rm apache-artemis-2.42.0-bin.tar.gz -
Maak de
artemis-gebruiker en stel de eigendom in:code language-bash # Create artemis user and set ownership sudo useradd -r -s /bin/false artemis 2>/dev/null || true sudo chown -R artemis:artemis /opt/artemis -
Een makelaarinstantie maken:
code language-bash sudo /opt/artemis/bin/artemis create /var/lib/artemis-instance --user artemis --password artemis --allow-anonymous sudo chown -R artemis:artemis /var/lib/artemis-instance -
Start de makelaar:
code language-bash # Start in foreground (for testing) sudo /var/lib/artemis-instance/bin/artemis run # Start as background service sudo /var/lib/artemis-instance/bin/artemis-service start # Stop the broker sudo /var/lib/artemis-instance/bin/artemis-service stop # Restart the broker sudo /var/lib/artemis-instance/bin/artemis-service restart # Force stop the broker sudo /var/lib/artemis-instance/bin/artemis-service force-stop # Check broker status sudo /var/lib/artemis-instance/bin/artemis-service status
ActiveMQ-artemis configureren
Controleer de officiële documentatie van de Artemis ActiveMQ om de makelaar te vormen en te beheren. Let op het volgende:
- Omgevingsvariabelen
- Poorttoegang (STOMP-protocol)
- Standaardgebruikersaccounts en -referenties
- Starten en stoppen van de makelaar
- Systeemlimieten en resourceaanpassing
Belangrijkste configuratiebestanden
/var/lib/artemis-instance/etc/broker.xml- Configuratie hoofdmakelaar/var/lib/artemis-instance/etc/artemis-users.properties- Gebruikersverificatie/var/lib/artemis-instance/etc/artemis-roles.properties- Gebruikersrollen/var/lib/artemis-instance/etc/bootstrap.xml- Bootstrap-configuratie
STOMP-protocol inschakelen
Controleer /var/lib/artemis-instance/etc/broker.xml om te controleren of de STOMP-acceptor is geconfigureerd:
<acceptors>
<acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true</acceptor>
<acceptor name="stomp">tcp://0.0.0.0:61613?protocols=STOMP</acceptor>
<acceptor name="stomp-ssl">tcp://0.0.0.0:61617?protocols=STOMP;sslEnabled=true;keyStorePath=/path/to/keystore.jks;keyStorePassword=password</acceptor>
</acceptors>
Als u SSL wilt inschakelen bij STOMP, moet u de stomp-ssl -acceptor expliciet toevoegen.
Installeren met ActiveMQ-arrays en verbinding maken
Als u Adobe Commerce na installeert u Artemis ActiveMQ, voeg de volgende bevel-lijn parameters tijdens installatie toe:
--stomp-host="<hostname>" --stomp-port="61613" --stomp-user="<user_name>" --stomp-password="<password>"
Waarbij:
--stomp-host--stomp-port61613 .--stomp-userartemis niet.--stomp-passwordartemis .--stomp-sslfalse . Als u de waarde aan waar plaatst, zie SSL voor meer informatie vormen.Connect ActiveMQ-artemis
Als het <install_directory>/app/etc/env.php -bestand al een Adobe Commerce-instantie bevat met de configuratie RabbitMQ (AMQP) en u wilt deze verbinding maken met ActiveMQ, vervangt u de sectie queue door STOMP, zodat deze op het volgende lijkt:
'queue' =>
array (
'stomp' =>
array (
'host' => 'activemq.example.com',
'port' => '61613', // SSL STOMP port (default 61617, non-SSL is 61613)
'user' => 'magento',
'password' => 'magento',
// Performance tuning options
'heartbeat_send' => 10000, // 10 seconds // Optional
'heartbeat_receive' => 10000, // 10 seconds // Optional
'read_timeout' => 250000 // 250ms // Optional
),
),
U kunt ActiveMQ-configuratiewaarden ook instellen met de opdracht bin/magento setup:config:set (verwijder de AMQP-configuratie als deze bestaat in het app/etc/env.php -bestand):
bin/magento setup:config:set --stomp-host="activemq.example.com" --stomp-port="61613" --stomp-user="magento" --stomp-password="magento"
Nadat u de opdracht hebt uitgevoerd of het <install_directory>/app/etc/env.php -bestand met STOMP-configuratiewaarden hebt bijgewerkt, voert u bin/magento setup:upgrade uit om de wijzigingen toe te passen en de vereiste wachtrijen in ActiveMQ te maken.
SSL configureren
Als u ondersteuning voor SSL wilt configureren, bewerkt u de parameters ssl en ssl_options in het <install_directory>/app/etc/env.php -bestand, zodat deze op het volgende lijken:
'queue' =>
array (
'stomp' =>
array (
'host' => 'activemq.example.com',
'port' => '61617', // SSL STOMP port (default 61617, non-SSL is 61613)
'user' => 'magento',
'password' => 'magento',
'ssl' => 'true',
'ssl_options' => [
'cafile' => '/etc/pki/tls/certs/DigiCertCA.crt',
'local_cert' => '/path/to/magento/app/etc/ssl/test-activemq.crt', // Optional: Client certificate for mutual SSL
'local_pk' => '/path/to/magento/app/etc/ssl/test-activemq.key', // Optional: Client private key for mutual SSL
'passphrase' => 'client_key_password', // Optional: Passphrase for client private key
'verify_peer' => true,
'verify_peer_name' => true,
'allow_self_signed' => false
],
// Performance tuning options
'heartbeat_send' => 10000, // 10 seconds // Optional
'heartbeat_receive' => 10000, // 10 seconds // Optional
'read_timeout' => 250000 // 250ms // Optional
),
),
SSL-configuratieopties
verify_peertrueverify_peer_nametrueallow_self_signedfalsecafilecertfilekeyfilepassphraseSSL-configuratie voor ontwikkeling
Voor ontwikkelomgevingen kunt u ontspannen SSL-instellingen gebruiken:
'ssl_options' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
Prestaties afstemmen
ActiveMQ Artemis biedt verschillende opties voor het afstemmen van prestaties:
'queue' =>
array (
'stomp' =>
array (
'host' => 'activemq.example.com',
'port' => '61613',
'user' => 'artemis',
'password' => 'artemis',
// Performance options
'heartbeat_send' => 10000, // Send heartbeat every 10 seconds
'heartbeat_receive' => 10000, // Expect heartbeat every 10 seconds
'read_timeout' => 250000, // 250ms read timeout
),
),
Toezicht en beheer
Webconsole
ActiveMQ Artemis biedt een webgebaseerde beheerconsole die toegankelijk is op:
- URL:
http://localhost:8161/console - Standaardreferenties:
artemis/artemis
Problemen oplossen
Algemene kwesties
- Verweigerde Verbinding: Verzeker Artemis ActiveMQ loopt en de accepteerder van STOMP wordt gevormd.
- Ontbroken Authentificatie: Controle gebruikersbenaming/wachtwoord in zowel makelaarconfiguratie als het
env.phpdossier. - ontbroken SSL handshake: Verifieer SSL certificaten en configuratie.
STOMP-verbinding controleren
STOMP-verbinding testen met Telnet:
telnet localhost 61613
Er moet een verbinding tot stand worden gebracht. Testen met een STOMP-opdracht:
# Test basic STOMP connection
echo -e "CONNECT\nhost:localhost\n\n\x00" | telnet localhost 61613
De verwachte output zou verbinding gevestigd en STOMP protocolreactie moeten tonen.
Gebruikers in de wachtrij met berichten starten
Nadat u Adobe Commerce en ActiveMQ Artemis hebt aangesloten, moet u de gebruikers van de berichtrij beginnen. Zie berichtrijen voor details vormen.