Rabbitmq 5

[ Rabbitmq ] Rabbitmq 사용하기 2 _ Request, Response 방식

Rabbutmq rpc 방식으로 클라이언트에서 버튼 클릭시 서버에서 랜덤으로 영문자를 보내는 테스트 코드 작성 1. .Net에서 Rabbitmq 를 편하게 사용하기 위해 Easynetq 를 NuGet 패키지에서 설치한다. 2. 서버코드 작성 랜덤으로 7자리 문자열을 받아온다 public static StringData GetRandomString() { StringData strResult = new StringData(); Random rand = new Random(); string strRandomChar = "qwertyuiopasdfghjklzxcvbnm"; StringBuilder rs = new StringBuilder(); for (int i = 0; i < 7; i++) { rs.Appe..

Rabbitmq 2022.12.27

[ Rabbitmq ] 서버에서 클라이언트로 hello world 보내기

서버 Rabbitmq 서버에 연결은 만든다 채널을 만든다. 채널이 생성되어 있는동안 큐를 선언해서 메시지를 클라이언트로 보낸다 using RabbitMQ.Client; using System; using System.Text; namespace RabbitmqServer { class Program { static void Main(string[] args) { var factory = new ConnectionFactory() { HostName = "localhost" };//ip using (var connection = factory.CreateConnection()) using (var channel = connection.CreateModel()) { channel.QueueDeclare(qu..

Rabbitmq 2022.12.27

[ Rabbitmq ] Rabbitmq 사용하기 1. Window 에 RabbitMQ 설치, management 띄우기

1. Rabbitmq 설치 https://www.rabbitmq.com/install-windows.html#installer Installing on Windows — RabbitMQ Installing on Windows This guide covers RabbitMQ installation on Windows. It focuses on the two recommended installation options: The guide also covers a few post-installation topics in the context of Windows: and more. These topics are covered in more det www.rabbitmq.com 여기서 직접 다운로드 눌러서 다운로드..

Rabbitmq 2022.12.27

[ Rabbitmq ] Rabbitmq 통신: c# 과 파이썬 이용해서 rabbitmq publish , consume

c# easynetq : publish , python pika : consume 1. pika consume credentials = pika.PlainCredentials('id','pw') # create connection connection = pika.BlockingConnection( pika.ConnectionParameters(host=ip, virtual_host='/', credentials=credentials)) # create channel channel = connection.channel() # declare queue result = channel.queue_declare(queue='MqttTestQueue', exclusive=True) queue_name = resul..

Rabbitmq 2022.09.04