Skip to content

Commit

Permalink
Ios added x-message-ttl
Browse files Browse the repository at this point in the history
  • Loading branch information
timhonders committed Nov 12, 2019
1 parent 5a4db5f commit 5a056a0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ios/RCTReactNativeRabbitMq/RabbitMqQueue.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,15 @@ -(id)initWithConfig:(NSDictionary *)config channel:(id<RMQChannel>)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){
Expand Down

0 comments on commit 5a056a0

Please sign in to comment.