Skip to content

Commit c1281a9

Browse files
committed
mix format and prettier
1 parent 8f42c96 commit c1281a9

3 files changed

Lines changed: 28 additions & 24 deletions

File tree

assets/svelte/sinks/kafka/KafkaSinkCard.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
<Tooltip.Content class="p-4 max-w-xs">
6666
<p class="text-sm text-muted-foreground font-normal">
6767
{#if consumer.sink.producer_compression === "lz4"}
68-
Set via <code>KAFKA_PRODUCER_COMPRESSION=lz4</code> environment variable.
68+
Set via <code>KAFKA_PRODUCER_COMPRESSION=lz4</code> environment
69+
variable.
6970
{:else}
7071
Set <code>KAFKA_PRODUCER_COMPRESSION=lz4</code> to enable LZ4 compression.
7172
{/if}

config/runtime.exs

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,14 @@ sqs_config =
7272
}
7373
end
7474

75-
# Enable via_sqs_for_new_sinks? flag for HttpPushSink
76-
config :sequin, Sequin.Consumers.HttpPushSink,
77-
via_sqs_for_new_sinks?: System.get_env("HTTP_PUSH_VIA_SQS_NEW_SINKS") in ~w(true 1)
78-
79-
# Configure the SQS pipeline with credentials
80-
config :sequin, Sequin.Runtime.HttpPushSqsPipeline,
81-
sqs: sqs_config,
82-
discards_disabled?: System.get_env("HTTP_PUSH_VIA_SQS_DISCARDS_DISABLED") in ~w(true 1)
83-
8475
kafka_producer_compression =
8576
case System.get_env("KAFKA_PRODUCER_COMPRESSION") do
86-
"lz4" -> :lz4
87-
nil -> :no_compression
77+
"lz4" ->
78+
:lz4
79+
80+
nil ->
81+
:no_compression
82+
8883
other ->
8984
raise """
9085
Invalid value for KAFKA_PRODUCER_COMPRESSION: #{inspect(other)}
@@ -94,23 +89,31 @@ kafka_producer_compression =
9489
"""
9590
end
9691

97-
config :sequin, Sequin.Consumers.KafkaSink,
98-
producer_compression: kafka_producer_compression
92+
# Enable via_sqs_for_new_sinks? flag for HttpPushSink
93+
config :sequin, Sequin.Consumers.HttpPushSink,
94+
via_sqs_for_new_sinks?: System.get_env("HTTP_PUSH_VIA_SQS_NEW_SINKS") in ~w(true 1)
95+
96+
config :sequin, Sequin.Consumers.KafkaSink, producer_compression: kafka_producer_compression
97+
98+
# Configure the SQS pipeline with credentials
99+
config :sequin, Sequin.Runtime.HttpPushSqsPipeline,
100+
sqs: sqs_config,
101+
discards_disabled?: System.get_env("HTTP_PUSH_VIA_SQS_DISCARDS_DISABLED") in ~w(true 1)
99102

100103
config :sequin, Sequin.Runtime.SlotProcessorServer,
101104
max_accumulated_bytes: ConfigParser.replication_flush_max_accumulated_bytes(env_vars),
102105
max_accumulated_messages: ConfigParser.replication_flush_max_accumulated_messages(env_vars),
106+
# ## Using releases
107+
#
108+
# If you use `mix release`, you need to explicitly enable the server
109+
# by passing the PHX_SERVER=true when you start it:
110+
#
111+
# PHX_SERVER=true bin/sequin start
112+
#
113+
# Alternatively, you can use `mix phx.gen.release` to generate a `bin/server`
114+
# script that automatically sets the env var above.
103115
max_accumulated_messages_time_ms: ConfigParser.replication_flush_max_accumulated_time_ms(env_vars)
104116

105-
# ## Using releases
106-
#
107-
# If you use `mix release`, you need to explicitly enable the server
108-
# by passing the PHX_SERVER=true when you start it:
109-
#
110-
# PHX_SERVER=true bin/sequin start
111-
#
112-
# Alternatively, you can use `mix phx.gen.release` to generate a `bin/server`
113-
# script that automatically sets the env var above.
114117
if System.get_env("PHX_SERVER") do
115118
config :sequin, SequinWeb.Endpoint, server: true
116119
config :sequin, SequinWeb.MetricsEndpoint, server: true

lib/sequin/consumers/kafka_sink.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ defmodule Sequin.Consumers.KafkaSink do
179179
|> maybe_add_ssl(sink)
180180
|> Keyword.put(:query_api_versions, true)
181181
|> Keyword.put(:auto_start_producers, true)
182-
|> Keyword.put(:default_producer_config, [compression: compression])
182+
|> Keyword.put(:default_producer_config, compression: compression)
183183
end
184184

185185
# Add SASL authentication if username/password are configured

0 commit comments

Comments
 (0)