-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathTest.java
More file actions
34 lines (27 loc) · 1.01 KB
/
Test.java
File metadata and controls
34 lines (27 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Envelope;
import com.rabbitmq.client.QueueingConsumer;
public class Test {
public void defaultConsumerTest(Channel channel) {
DefaultConsumer consumer = new DefaultConsumer(channel) {
@Override
public void handleDelivery(
String consumerTag, Envelope envelope, AMQP.BasicProperties properties,
byte[] body) { // $ source
sink(body); // $ hasTaintFlow
}
};
}
public void queueingConsumerTest(QueueingConsumer consumer) {
while (true) {
QueueingConsumer.Delivery delivery = consumer.nextDelivery(); // $ source
sink(delivery.getBody()); // $ hasTaintFlow
delivery = consumer.nextDelivery(42); // $ source
sink(delivery.getBody()); // $ hasTaintFlow
}
}
private void sink(byte[] data) {
}
}