검색

5.3. AMQ Broker 예제 프로그램 실행

download PDF

AMQ Broker용 프로그램의 예는 제품의 기본 및 고급 기능을 보여줍니다. Maven을 사용하여 이러한 프로그램을 실행합니다.

사전 요구 사항

프로세스

  1. 실행하려는 예제의 디렉터리로 이동합니다. 다음 예제에서는 예제를 amq-broker-examples 라는 디렉터리에 다운로드했다고 가정합니다.

    $ cd amq-broker-examples/examples/features/standard/queue
  2. mvn clean verify 명령을 사용하여 example 프로그램을 실행합니다.

    Maven은 브로커를 시작하고 example 프로그램을 실행합니다. Maven은 예제 프로그램을 처음 실행할 때 누락된 종속성을 다운로드합니다. 이 종속성을 실행하는 데 시간이 걸릴 수 있습니다.

    이 경우 예제 프로그램이 실행되어 생산자를 생성하고 테스트 메시지를 보낸 다음 메시지를 수신하는 소비자를 생성합니다.

    $ mvn clean verify
    [INFO] Scanning for projects...
    [INFO]
    [INFO] -------------< org.apache.activemq.examples.broker:queue >--------------
    [INFO] Building ActiveMQ Artemis JMS Queue Example 2.6.1.amq-720004-redhat-1
    [INFO] --------------------------------[ jar ]---------------------------------
    ...
    server-out:2018-12-05 16:37:57,023 INFO  [org.apache.activemq.artemis.core.server] AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.6.1.amq-720004-redhat-1 [0.0.0.0, nodeID=06f529d3-f8d6-11e8-9bea-0800271b03bd]
    [INFO] Server started
    [INFO]
    [INFO] --- artemis-maven-plugin:2.6.1.amq-720004-redhat-1:runClient (runClient) @ queue ---
    Sent message: This is a text message
    Received message: This is a text message
    [INFO]
    [INFO] --- artemis-maven-plugin:2.6.1.amq-720004-redhat-1:cli (stop) @ queue ---
    server-out:2018-12-05 16:37:59,519 INFO  [org.apache.activemq.artemis.core.server] AMQ221002: Apache ActiveMQ Artemis Message Broker version 2.6.1.amq-720004-redhat-1 [06f529d3-f8d6-11e8-9bea-0800271b03bd] stopped, uptime 3.734 seconds
    server-out:Server stopped!
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  48.681 s
    [INFO] Finished at: 2018-12-05T16:37:59-05:00
    [INFO] ------------------------------------------------------------------------
    참고

    예제 프로그램 중 일부는 UDP 클러스터링을 사용하며 기본적으로 사용자 환경에서 작동하지 않을 수 있습니다. 이러한 예제를 성공적으로 실행하려면 224.0.0.0으로 전송되는 트래픽을 루프백 인터페이스로 리디렉션합니다.

    $ sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.