ExportTaskMessageConsumer.cs 682 B

12345678910111213141516171819202122
  1. using RestSharp;
  2. using SMP.Contract.Message;
  3. using SMP.Message.Consumer.Config;
  4. using SMP.Model.ExportTask;
  5. namespace SMP.Message.Consumer.MQConsumers
  6. {
  7. public class ExportTaskMessageConsumer : BaseConsumer<Finance_ExportTask>
  8. {
  9. public override void Consume(Finance_ExportTask message)
  10. {
  11. var options = new RestClientOptions(RabbitMqConfig.ExportTaskApi)
  12. {
  13. Timeout = -1,
  14. };
  15. var client = new RestClient(options);
  16. RestRequest request = new RestRequest();
  17. request.AddJsonBody(message);
  18. var result = client.ExecutePostAsync(request).Result;
  19. }
  20. }
  21. }