Don't read tasks from Roadrunner's consumer, need help! #2150
-
I am new in Roadrunner (ghcr.io/roadrunner-server/roadrunner:2024.3.5). Wrote simple consumer: $consumer = new \Spiral\RoadRunner\Jobs\Consumer();
while ($task = $consumer->waitTask()) {
try {
if (!$task instanceof \Spiral\RoadRunner\Jobs\Task\ReceivedTaskInterface) {
$logger->critical("🔥 FATAL ERROR");
}
$payload = json_decode($task->getPayload(), true);
(new MyWorker($logger))->handle($payload);
$task->complete();
} catch (\Exception $e) {
$task->fail($e->getMessage());
$logger->critical("🔥 FATAL ERROR: " . $e->getMessage());
}
} My .rr.yaml: version: "3"
rpc:
listen: "tcp://0.0.0.0:6001"
log_level: debug
enable: true
server:
command: "php worker-rr.php"
relay: "pipes"
env:
APP_RUNTIME: Runtime\RoadRunnerSymfonyNyholm\Runtime
plugins:
jobs: true
kafka: true
kafka:
brokers: ["10.254.3.89:9092", "10.254.3.88:9092", "10.254.3.90:9092"]
ping:
timeout: "10s"
local-memory:
driver: memory
config: { }
jobs:
consume:
- kafka_pipeline
- in_memory
num_pollers: 1
pipeline_size: 1000
pool:
num_workers: 1
max_jobs: 0
allocate_timeout: 60s
destroy_timeout: 60s
pipelines:
in_memory:
# In memory driver specific section
#
# Default: none
driver: memory
config: { }
kafka_pipeline:
driver: kafka
config:
priority: 10
auto_offset_reset: "earliest"
auto_create_topics_enable: false
producer_options:
disable_idempotent: false
required_acks: AllISRAck
max_message_bytes: 1000012
request_timeout: 10s
delivery_timeout: 100s
transaction_timeout: 100
compression_codec: gzip
consumer_options:
topics: ["my_topic"]
consume_partitions:
my_topic:
0:
type: AtStart
value: 1
1:
type: AtStart
value: 1
2:
type: AtStart
value: 1
3:
type: AtStart
value: 1
group_options:
group_id: my.group
logs:
mode: development
level: debug After starting a connection, I received these logs:
Terminal's display:
|
Beta Was this translation helpful? Give feedback.
Answered by
sayankanatov
Mar 17, 2025
Replies: 2 comments 2 replies
-
Hey @sayankanatov 👋🏻 |
Beta Was this translation helpful? Give feedback.
2 replies
-
blocks |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rustatian
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
blocks
producer_options
andconsumer_options
should be underconfig
block. This is solution!