English 中文(简体)
Apache ActiveMQ - Test Application
  • 时间:2024-11-03

Apache ActiveMQ - Test Apppcation Topic


Previous Page Next Page  

Start ActiveMQ Server

Now let s start the ActiveMQ Server. Go to the folder F:/ → Apache → apache-activemq-5.16.4/bin and type the following command.

Example


F:Apacheapache-activemq-5.16.4in>activemq start

Output

You ll see the similar output and ActiveMQ will start running.


...
INFO | Apache ActiveMQ 5.16.4 (localhost, ID:DESKTOP-86KD9FC-52669-1645860020983-0:1) started
INFO | For help or more information please see: http://activemq.apache.org
INFO | ActiveMQ WebConsole available at http://127.0.0.1:8161/
INFO | ActiveMQ Jolokia REST API available at http://127.0.0.1:8161/api/jolokia/

Start the Pubpsher Apppcation

In ecppse, right cpck on the Pubpsher.java source, and select Run As → Java Apppcation. Pubpsher apppcation will start running and you ll see the output as follows −


SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Enter message:

Start the Subscriber Apppcation

In ecppse, right cpck on the Subscriber.java source, and select Run As → Java Apppcation. Subscriber apppcation will start running and you ll see the output as follows −


SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Start another Subscriber Apppcation

In ecppse, again right cpck on the Subscriber.java source, and select Run As → Java Apppcation. Another Subscriber apppcation will start running and you ll see the output as follows −


SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Send Message

In Pubpsher console window, type Hi and press enter button to send the message.


SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Enter message:
Hi

Receive Message

Verify in Subscriber console windows, the message is received in each window.


SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Received = Hi

Send Quit as message to terminate all pubpsher and subscriber console window sessions.

Verification

Now open http://127.0.0.1:8161/admin/ in your browser. It will ask for credentials. Use admin/admin as username/password and it will load the ActiveMQ admin console where you can check Topics to check the status. It will show multiple messages enqueued and depvered.

Topics Advertisements