Alex Bryant
07/04/2023, 6:23 AMstream data structure, as opposed to queue for RabbitMQ. We are setting up a basic job and have managed to get the connector working with the queue type, but not stream.
version: '3.3'
services:
jobmanager:
image: flink:1.17.0
expose:
- '8081'
ports:
- '8081:8081'
command: jobmanager
environment:
- JOB_MANAGER_RPC_ADDRESS=jobmanager
- JOB_MANAGER_RPC_PORT=6123
- MQ_IP=${MQ_IP}
- MQ_PORT=${MQ_PORT}
- MQ_Q=${MQ_Q}
- MQ_UN=${MQ_UN}
- MQ_PW=${MQ_PW}
taskmanager:
image: flink:1.17.0
depends_on:
- jobmanager
expose:
- '6121'
ports:
- '6121:6121'
command: taskmanager
environment:
- JOB_MANAGER_RPC_ADDRESS=jobmanager
- JOB_MANAGER_RPC_PORT=6123
- TASK_MANAGER_NUMBER_OF_TASK_SLOTS=4
networks:
dev-network:
driver: bridge
Connector version:
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-rabbitmq</artifactId>
<version>3.0.1-1.17</version>
</dependency>
Connecting to RabbitMQ:
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
System.out.println("Connecting....................");
String MQ_IP = System.getenv("MQ_IP");
int MQ_PORT = Integer.parseInt(System.getenv("MQ_PORT"));
String MQ_UN = System.getenv("MQ_UN");
String MQ_PW = System.getenv("MQ_PW");
String MQ_Q = System.getenv("MQ_Q");
// RabbitMQ connection configuration
RMQConnectionConfig connectionConfig =
new RMQConnectionConfig.Builder()
.setHost(MQ_IP)
.setPort(MQ_PORT)
.setUserName(MQ_UN)
.setPassword(MQ_PW)
.setVirtualHost("/")
.build();
// Create RabbitMQ source
RMQSource<String> source = new RMQSource<>(
connectionConfig, MQ_Q, true, new SimpleStringSchema());
DataStream<String> stream = env
.addSource(source)
.name("RabbitMQ Source");
stream.print();
Does anyone know if this is supported? If so, how can this be accomplished?
We have tried using ("x-queue-type", "stream") in ClientProperties but were unsuccessful.
We'd appreciate some support, even if the advice is to take a different approach. Thanks!Martijn Visser
07/04/2023, 6:28 AMAlex Bryant
07/04/2023, 6:32 AMMartijn Visser
07/04/2023, 6:48 AMMartijn Visser
07/04/2023, 6:49 AMAlex Bryant
07/05/2023, 12:34 AM