Skip to content

Commit

Permalink
use global producer_id, consumer_id, request_id
Browse files Browse the repository at this point in the history
remove async produce
  • Loading branch information
yang-bsft committed Mar 26, 2023
1 parent f6804a5 commit 887011f
Show file tree
Hide file tree
Showing 51 changed files with 6,280 additions and 3,321 deletions.
2 changes: 1 addition & 1 deletion .formatter.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
Enum.flat_map(
["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"],
&Path.wildcard(&1, match_dot: true)
) -- ["lib/pulsar/proto.ex"]
) -- ["lib/pulsar_ex/proto.ex"]
]
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ tags
.DS_Store

*.swp

data
47 changes: 0 additions & 47 deletions Dockerfile

This file was deleted.

101 changes: 12 additions & 89 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -1,97 +1,20 @@
import Config

config :logger, level: :debug

config :logger, :console,
format: "$time [$level] $message $metadata\n",
metadata: [:application, :module, :payload, :job]

config :pulsar_ex,
shutdown_timeout: 5_000,
clusters: [
[
cluster: :dev,
brokers: ["localhost"],
admin_port: 8080,
num_executors: 5,
socket_opts: [],
connection_timeout: 5_000,
num_connections: 1,
health_check: false,
producer_opts: [
auto_start: false,
batch_enabled: false,
batch_size: 100,
flush_interval: 3000,
properties: [client: "pulsar_ex"],
refresh_interval: 1000,
num_producers: 1
],
consumer_opts: [
auto_start: true,
properties: [client: "pulsar_ex"]
],
producers: [
# [
# topic: "persistent://public/default/test.json",
# producer_access_mode: :shared,
# properties: [test: true]
# ]
],
consumers: [
# [
# topic: "persistent://public/default/test.json",
# subscription: "test",
# module: PulsarEx.TestWorker,
# properties: [test: false],
# refresh_interval: 15_000,
# num_consumers: 30,
# module: PulsarEx.DefaultWorker
# ]
],
auto_setup: true,
tenants: [],
namespaces: [],
topics: [],
partitioned_topics: []
]
],
cluster: :default,
brokers: ["localhost"],
admin_port: 8080,
num_executors: 5,
socket_opts: [],
connection_timeout: 5_000,
num_connections: 1,
health_check: false,
producer_opts: [
auto_start: false,
batch_enabled: false,
batch_size: 100,
flush_interval: 3000,
properties: [client: "pulsar_ex"],
refresh_interval: 1000,
num_producers: 1
],
consumer_opts: [
auto_start: true,
properties: [client: "pulsar_ex"]
],
producers: [
# [
# topic: "persistent://public/default/test.json",
# producer_access_mode: :shared,
# properties: [test: true]
# ]
metadata: [
:application,
:module,
:cluster,
:broker,
:topic,
:producer_id,
:consumer_id
],
consumers: [
# [
# topic: "persistent://public/default/test.json",
# subscription: "test",
# module: PulsarEx.TestWorker,
# properties: [test: false],
# refresh_interval: 15_000,
# num_consumers: 30,
# module: PulsarEx.DefaultWorker
# ]
compile_time_purge_matching: [
[application: :tzdata]
]

import_config "#{Mix.env()}.exs"
11 changes: 10 additions & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
import Config

config :logger, level: :debug
config :pulsar_ex,
shutdown_timeout: 5_000,
brokers: ["localhost"],
port: 6650,
admin_port: 8080,
socket_opts: [],
connection_timeout: 5_000,
num_connections: 1,
producer_opts: [],
consumer_opts: []
23 changes: 18 additions & 5 deletions config/integration.exs
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import Config

config :logger, level: :info
config :logger, backends: []

config :pulsar_ex, :statsd, host: "localhost", port: 8125

config :pulsar_ex,
divo: [
{DivoPulsar, [port: 8080, version: "2.8.1"]}
],
divo_wait: [dwell: 10_000, max_tries: 50]
cluster_name: "integration",
brokers: ["localhost"],
port: 6651,
admin_port: 8081,
num_connections: 1,
auto_setup: true,
producer_opts: [compression: :lz4],
tenants: ["pulsar_ex"],
namespaces: ["pulsar_ex/IntegrationTest"],
topics: [
"persistent://pulsar_ex/IntegrationTest/SimpleTopicWorkerTest",
"persistent://pulsar_ex/IntegrationTest/SimpleTopicWorkerTest.dead_letters",
{"persistent://pulsar_ex/IntegrationTest/TestPartitionedTopicWorker", 15},
"persistent://pulsar_ex/IntegrationTest/TestPartitionedTopicWorker.dead_letters"
]
12 changes: 12 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
import Config

config :logger, backends: []

config :pulsar_ex, :statsd, host: "localhost", port: 8125

config :pulsar_ex,
connection_module: PulsarEx.TestConnection,
cluster_name: "unit",
brokers: ["localhost"],
port: 66500,
admin_port: 80800,
num_connections: 1
Loading

0 comments on commit 887011f

Please sign in to comment.