Questions tagged [consumer]

649 questions
97
votes
5 answers

How do I set a number of retry attempts in RabbitMQ?

I am using RabbitMQ and I have a queue that holds email messages. My consumer service de-queues messages and attempts to send them. If, for any reason, my consumer cannot send the message, I would like to re-queue the message to send again. I…
user2689570
  • 1,331
  • 1
  • 11
  • 11
55
votes
6 answers

Library for OAuth Provider (Java)

I'm looking for a Java library that helps me building an OAuth Provider. I must be able to receive OAuth signed requests and determine whether they are valid or not (checking the signature, timestamp and nonce values). Do you know if there's…
Pablo Fernandez
  • 103,170
  • 56
  • 192
  • 232
51
votes
3 answers

Does the JDK provide a dummy consumer?

I have a need in a block of code to consume 'n' items from a stream then finish, in essence: public static void eat(Stream stream, int n) // consume n items of the stream (and throw them away) } In my situation, I can't change the…
Bohemian
  • 412,405
  • 93
  • 575
  • 722
47
votes
2 answers

How do I implement secure OAuth2 consumption in Javascript?

I'm in the process of designing an API in PHP that will use OAuth2.0. My end goal is to build a front-end application in javascript (using AngularJS) that accesses this API directly. I know that traditionally there's no way to secure transactions in…
David Myers
  • 799
  • 1
  • 9
  • 18
46
votes
1 answer

Fast and Best Producer/consumer queue technique BlockingCollection vs concurrent Queue

Im using Generic.Queue in C# 3.0 and Monitor.Enter,wait,exit for wait before consuming the queue (wait for the element to be enqueued). Now im moving to C# 4. Can anyone suggest me which one is fast and best especially to avoid…
C-va
  • 2,910
  • 4
  • 27
  • 42
29
votes
3 answers

multiple consumers per kinesis shard

I read you can have multiple consumer apps per kinesis stream. http://docs.aws.amazon.com/kinesis/latest/dev/developing-consumers-with-kcl.html however, I heard you can only have on consumer per shard. Is this true? I don't find any documentation…
bhomass
  • 3,414
  • 8
  • 45
  • 75
21
votes
3 answers

Java 8 Consumer and side effects

I am new to Java 8, I came across Consumer java doc and it says, "Consumer is expected to operate via side-effects." Could somebody please explain why it is said so ?
user6348242
  • 211
  • 2
  • 8
18
votes
5 answers

How to retrieve message from WEB API?

I created some web apis and when an error happens the api returns HttpResponseMessage that is created with CreateErrorResponse message. Something like this: return Request.CreateErrorResponse( HttpStatusCode.NotFound, "Failed to find…
Vadim
  • 21,044
  • 18
  • 65
  • 101
16
votes
1 answer

consumer.How to specify partition to read? [kafka]

I am learning Kafka and I want to know how to specify then partition when I consume messages from a topic. I have found several pictures like this: It means that a consumer can consume messages from several partitions but a partition can only be…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
15
votes
2 answers

What is the c# equivalent of Java 8 java.util.function.Consumer<>?

Is there an equivalent of this interface in C#? Example: Consumer consumer = new Consumer<>(); consumer.accept(data[11]); I have searched around Func<> and Action<> but I have no idea. The original Java code of Consumer.accept() interface is…
vil.coyote.ch
  • 193
  • 1
  • 8
14
votes
3 answers

Topic can't be found when producing messages: UNKNOWN_TOPIC_OR_PARTITION

I have a two-nodes Kafka cluster (EC2 instances) where each node is used as a separate broker. When I run a producer on the leader instance with the following command: kafka-console-producer.sh --broker-list localhost:9092 --topic test I get the…
saloua
  • 2,433
  • 4
  • 27
  • 37
13
votes
2 answers

How to remove a Kafka consumer group from a specific topic?

I changed the consumer-group-id of my web service listening to a Kafka topic. Now, the old group id is still registered to the topic, but there is no consumer with that group id. Therefore, it is lagging. How can I remove a specific consumer group…
Cagatay
  • 305
  • 1
  • 3
  • 10
13
votes
1 answer

How to stop consuming message from selective queue - RabbitMQ

QueueingConsumer consumer = new QueueingConsumer(channel); System.out.println(consumer.getConsumerTag()); channel.basicConsume("queue1", consumer); channel.basicConsume("queue3", consumer); Is it possible to stop consuming the messages from the…
user1182253
  • 1,079
  • 2
  • 14
  • 26
10
votes
2 answers

Optionally getting field

I have a class structure like this: public class Foo { private FooB foob; public Optional getFoob() { return Optional.ofNullable(foob); } } public class FooB { private int valA; public int getValA() { …
Richard
  • 5,840
  • 36
  • 123
  • 208
8
votes
3 answers

Way to break a connection from rabbitmq

I've got an application which has some bugs. For some reason 2 consumers are created when only one should be there - and one of them is not checked for messages anymore. I can detect that situation by listing queues and the number of consumers on…
viraptor
  • 33,322
  • 10
  • 107
  • 191
1
2 3
43 44