From 5a056a04940a42697ef608798adde458e9c23e39 Mon Sep 17 00:00:00 2001 From: Tim Honders Date: Tue, 12 Nov 2019 14:10:37 +0100 Subject: [PATCH] Ios added x-message-ttl --- ios/RCTReactNativeRabbitMq/RabbitMqQueue.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ios/RCTReactNativeRabbitMq/RabbitMqQueue.m b/ios/RCTReactNativeRabbitMq/RabbitMqQueue.m index 162aa81..c843569 100644 --- a/ios/RCTReactNativeRabbitMq/RabbitMqQueue.m +++ b/ios/RCTReactNativeRabbitMq/RabbitMqQueue.m @@ -50,10 +50,15 @@ -(id)initWithConfig:(NSDictionary *)config channel:(id)channel { if ([config objectForKey:@"consumer_arguments"] != nil){ NSDictionary *consumer_arguments = [config objectForKey:@"consumer_arguments"]; + + if ([consumer_arguments objectForKey:@"x-message-ttl"] != nil){ + NSNumber *ttl = [consumer_arguments objectForKey:@"x-message-ttl"]; + [tmp_arguments setObject:[[RMQSignedShort alloc] init:[ttl integerValue]] forKey:@"x-message-ttl"]; + } + if ([consumer_arguments objectForKey:@"x-priority"] != nil){ NSNumber *xpriority = [consumer_arguments objectForKey:@"x-priority"]; - NSInteger priority = [xpriority integerValue]; - [tmp_arguments setObject:[[RMQSignedShort alloc] init:priority] forKey:@"x-priority"]; + [tmp_arguments setObject:[[RMQSignedShort alloc] init:[xpriority integerValue]] forKey:@"x-priority"]; } if ([consumer_arguments objectForKey:@"x-single-active-consumer"] != nil){