- 다른 뜻에 대해서는 (amqp-cli) amqp-consume 문서를 참조하십시오.
1 개요[ | ]
- amqp-consume
- /usr/bin/amqp-consume
- AMQP 서버 상의 큐에서 메시지를 소비하는 명령어
- AMQP basic.consume 메소드 사용
Bash
Copy
amqp-consume -q myqueue cat
- → 'myqueue'라는 큐에서 메시지를 인출하여, 그 내용을 cat을 통해 출력
Bash
Copy
amqp-consume -A -e myexch ./myscript
- → 'myexch'라는 exchange에 새로운 배타적 큐를 연결하고, 각 메시지 내용을 ./myscript 에 전달
2 실행예시[ | ]
- consume을 걸어둠
Console
Copy
root@zetawiki:~# amqp-consume -e amq.direct -r key1 cat
Server provided queue name: amq.gen--CLHlLO0a8f_wf9mi2vLzA
- 다른 SSH세션에서 amqp-publish를 수행
Console
Copy
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세션에서 출력내용
Console
Copy
root@zetawiki:~# amqp-consume -e amq.direct -r key1 cat
Server provided queue name: amq.gen--CLHlLO0a8f_wf9mi2vLzA
hello1hello2hello3
3 실행예시 2[ | ]
- consume을 걸어둠
Console
Copy
root@zetawiki:~# amqp-consume -e amq.direct -r key1 -q q1 cat
- 다른 SSH세션에서 amqp-publish를 수행
Console
Copy
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세션에서 출력내용
Console
Copy
root@zetawiki:~# amqp-consume -e amq.direct -r key1 -q q1 cat
hello1hello2hello3
4 같이 보기[ | ]
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.