"리눅스 amqp-consume"의 두 판 사이의 차이

잔글 (Jmnote님이 Amqp-consume 문서를 리눅스 amqp-consume 문서로 이동했습니다)
잔글 (Jmnote님이 Amqp-consume 문서를 리눅스 amqp-consume 문서로 이동했습니다)
 
(같은 사용자의 중간 판 10개는 보이지 않습니다)
1번째 줄: 1번째 줄:
{{다른뜻|(amqp-cli) amqp-consume}}
==개요==
==개요==
;amqp-consume
;amqp-consume
;/usr/bin/amqp-consume
;/usr/bin/amqp-consume
* AMQP 서버 상의 큐에서 메시지를 소비하는 명령어
* AMQP 서버 상의 큐에서 메시지를 소비하는 명령어
* AMQP basic.consume 메소드 사용


<source lang='bash'>
<source lang='bash'>
12번째 줄: 14번째 줄:
</source>
</source>
:→ 'myexch'라는 exchange에 새로운 배타적 큐를 연결하고, 각 메시지 내용을 ./myscript 에 전달
:→ 'myexch'라는 exchange에 새로운 배타적 큐를 연결하고, 각 메시지 내용을 ./myscript 에 전달
==실행예시==
* consume을 걸어둠
<source lang='console'>
root@zetawiki:~# amqp-consume -e amq.direct -r key1 cat
Server provided queue name: amq.gen--CLHlLO0a8f_wf9mi2vLzA
</source>
* 다른 SSH세션에서 amqp-publish를 수행
<source lang='console'>
root@zetawiki:~# amqp-publish -e amq.direct -r key1 -b hello1
root@zetawiki:~# amqp-publish -e amq.direct -r key1 -b hello2
root@zetawiki:~# amqp-publish -e amq.direct -r key1 -b hello3
root@zetawiki:~#
</source>
* 아까 consume하던 SSH세션에서 출력내용
<source lang='console'>
root@zetawiki:~# amqp-consume -e amq.direct -r key1 cat
Server provided queue name: amq.gen--CLHlLO0a8f_wf9mi2vLzA
hello1hello2hello3
</source>
==실행예시 2==
* consume을 걸어둠
<source lang='console'>
root@zetawiki:~# amqp-consume -e amq.direct -r key1 -q q1 cat
</source>
* 다른 SSH세션에서 amqp-publish를 수행
<source lang='console'>
root@zetawiki:~# amqp-publish -e amq.direct -r key1 -b hello1
root@zetawiki:~# amqp-publish -e amq.direct -r key1 -b hello2
root@zetawiki:~# amqp-publish -e amq.direct -r key1 -b hello3
root@zetawiki:~#
</source>
* 아까 consume하던 SSH세션에서 출력내용
<source lang='console'>
root@zetawiki:~# amqp-consume -e amq.direct -r key1 -q q1 cat
hello1hello2hello3
</source>


==같이 보기==
==같이 보기==
* [[amqp-publish]]
* [[(amqp-tools) amqp-publish|amqp-publish]]
* [[amqp-get]]
* [[amqp-get]]
* [[amqp-tools 패키지]]
* [[amqp-tools 패키지]]
* [[(amqp-cli) amqp-consume]]


[[분류: amqp-tools]]
[[분류: amqp-tools]]
[[분류: /usr/bin]]
[[분류: /usr/bin]]

2016년 12월 15일 (목) 14:45 기준 최신판

  다른 뜻에 대해서는 (amqp-cli) amqp-consume 문서를 참조하십시오.

1 개요[ | ]

amqp-consume
/usr/bin/amqp-consume
  • AMQP 서버 상의 큐에서 메시지를 소비하는 명령어
  • AMQP basic.consume 메소드 사용
amqp-consume -q myqueue cat
→ 'myqueue'라는 큐에서 메시지를 인출하여, 그 내용을 cat을 통해 출력
amqp-consume -A -e myexch ./myscript
→ 'myexch'라는 exchange에 새로운 배타적 큐를 연결하고, 각 메시지 내용을 ./myscript 에 전달

2 실행예시[ | ]

  • consume을 걸어둠
root@zetawiki:~# amqp-consume -e amq.direct -r key1 cat
Server provided queue name: amq.gen--CLHlLO0a8f_wf9mi2vLzA
  • 다른 SSH세션에서 amqp-publish를 수행
root@zetawiki:~# amqp-publish -e amq.direct -r key1 -b hello1
root@zetawiki:~# amqp-publish -e amq.direct -r key1 -b hello2
root@zetawiki:~# amqp-publish -e amq.direct -r key1 -b hello3
root@zetawiki:~#
  • 아까 consume하던 SSH세션에서 출력내용
root@zetawiki:~# amqp-consume -e amq.direct -r key1 cat
Server provided queue name: amq.gen--CLHlLO0a8f_wf9mi2vLzA
hello1hello2hello3

3 실행예시 2[ | ]

  • consume을 걸어둠
root@zetawiki:~# amqp-consume -e amq.direct -r key1 -q q1 cat
  • 다른 SSH세션에서 amqp-publish를 수행
root@zetawiki:~# amqp-publish -e amq.direct -r key1 -b hello1
root@zetawiki:~# amqp-publish -e amq.direct -r key1 -b hello2
root@zetawiki:~# amqp-publish -e amq.direct -r key1 -b hello3
root@zetawiki:~#
  • 아까 consume하던 SSH세션에서 출력내용
root@zetawiki:~# amqp-consume -e amq.direct -r key1 -q q1 cat
hello1hello2hello3

4 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}