24 lines
646 B
C#
24 lines
646 B
C#
using RabbitMQ.Client;
|
|
using System.Text;
|
|
|
|
namespace BMA.EHR.Leave.Service.Services
|
|
{
|
|
public class RabbitCheckInService
|
|
{
|
|
private readonly IModel _channel;
|
|
|
|
public RabbitCheckInService(IModel channel)
|
|
{
|
|
_channel = channel;
|
|
}
|
|
|
|
public void SendMessageToQueue(string queueName, byte[] body)
|
|
{
|
|
//var body = Encoding.UTF8.GetBytes(message);
|
|
_channel.BasicPublish(exchange: "",
|
|
routingKey: queueName,
|
|
basicProperties: null,
|
|
body: body);
|
|
}
|
|
}
|
|
}
|