nats_wave 1.1.16 → 1.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/nats_wave/adapters/datadog_metrics.rb +1 -1
- data/lib/nats_wave/concerns/mappable.rb +9 -9
- data/lib/nats_wave/configuration.rb +1 -1
- data/lib/nats_wave/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96d6d8104b53ea2928cb582117540bee7ea2e6b7f53cd59d6fe45e4b425951dc
|
4
|
+
data.tar.gz: 54f25e266faeef7de1f7596582d16d755aa37a50969fc07e1249f9cef48311ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c891b5df233ab589e4481fe88b6c37900c1577fcac0f84babef441c31a4966c8cc1725419cbd12ac69eb07e196cdc0446212ea0fb230a99a018a6bbfcefc07d
|
7
|
+
data.tar.gz: 76e24d165d453ca8f51450e1eaa44a2823778928855ba1182d000aa22f6bf42c73a64d8e1174bb85fafd7430755e73a0b31ba0bdece98d3babf657fd321c0282
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1037,7 +1037,7 @@ module NatsWave
|
|
1037
1037
|
|
1038
1038
|
# Configure publishing with optional custom handler AND auto-publishing callbacks
|
1039
1039
|
def nats_wave_publishes_to(*subjects, **options, &block)
|
1040
|
-
NatsWave.logger.debug "
|
1040
|
+
NatsWave.logger.debug "⚙️ #{self.name}: Setting up publishing to subjects: #{subjects.inspect}"
|
1041
1041
|
|
1042
1042
|
# Custom handler is now optional and runs AFTER default behavior
|
1043
1043
|
custom_handler = options[:handler] || block
|
@@ -1062,7 +1062,7 @@ module NatsWave
|
|
1062
1062
|
# Add ActiveRecord callbacks for auto-publishing (only once per model)
|
1063
1063
|
setup_publishing_callbacks_once
|
1064
1064
|
|
1065
|
-
NatsWave.logger.debug "
|
1065
|
+
NatsWave.logger.debug "⚙️ #{self.name}: Registered publishing config for subjects: #{subjects}"
|
1066
1066
|
end
|
1067
1067
|
|
1068
1068
|
# Get all subscription configurations
|
@@ -1222,7 +1222,7 @@ module NatsWave
|
|
1222
1222
|
after_commit :trigger_nats_wave_auto_publish_on_destroy, on: :destroy
|
1223
1223
|
|
1224
1224
|
@nats_wave_callbacks_added = true
|
1225
|
-
NatsWave.logger.debug "
|
1225
|
+
NatsWave.logger.debug "⚙️ #{self.name}: Added publishing callbacks"
|
1226
1226
|
end
|
1227
1227
|
|
1228
1228
|
# Create a subscription handler that processes data and calls custom handler AFTER auto-sync
|
@@ -1231,7 +1231,7 @@ module NatsWave
|
|
1231
1231
|
|
1232
1232
|
lambda do |message|
|
1233
1233
|
begin
|
1234
|
-
NatsWave.logger.debug "⚙️Processing subscription message for #{model_class.name}"
|
1234
|
+
NatsWave.logger.debug "⚙️ Processing subscription message for #{model_class.name}"
|
1235
1235
|
|
1236
1236
|
# Extract the raw data
|
1237
1237
|
raw_data = message['data'] || {}
|
@@ -1250,7 +1250,7 @@ module NatsWave
|
|
1250
1250
|
# Handle nested data structure
|
1251
1251
|
if raw_data['data'].is_a?(Hash)
|
1252
1252
|
raw_data = raw_data['data']
|
1253
|
-
NatsWave.logger.debug "⚙️Using nested data structure"
|
1253
|
+
NatsWave.logger.debug "⚙️ Using nested data structure"
|
1254
1254
|
end
|
1255
1255
|
|
1256
1256
|
# Process the data through mappings and transformations
|
@@ -1258,13 +1258,13 @@ module NatsWave
|
|
1258
1258
|
|
1259
1259
|
# Always perform auto-sync first (if enabled)
|
1260
1260
|
if config[:auto_sync]
|
1261
|
-
NatsWave.logger.debug "⚙️Performing auto-sync first"
|
1261
|
+
NatsWave.logger.debug "⚙️ Performing auto-sync first"
|
1262
1262
|
model_class.perform_auto_sync(model_name, action, processed_data, config)
|
1263
1263
|
end
|
1264
1264
|
|
1265
1265
|
# Then call custom handler if provided (optional)
|
1266
1266
|
if config[:custom_handler]
|
1267
|
-
NatsWave.logger.debug "⚙️Calling custom subscription handler after auto-sync"
|
1267
|
+
NatsWave.logger.debug "⚙️ Calling custom subscription handler after auto-sync"
|
1268
1268
|
config[:custom_handler].call(model_name, action, processed_data, message)
|
1269
1269
|
end
|
1270
1270
|
|
@@ -1287,7 +1287,7 @@ module NatsWave
|
|
1287
1287
|
|
1288
1288
|
# Check conditions (only for publishing)
|
1289
1289
|
if config[:conditions].any? && !evaluate_conditions(config[:conditions])
|
1290
|
-
NatsWave.logger.debug "⚙️Skipping publish - conditions not met"
|
1290
|
+
NatsWave.logger.debug "⚙️ Skipping publish - conditions not met"
|
1291
1291
|
next
|
1292
1292
|
end
|
1293
1293
|
|
@@ -1315,7 +1315,7 @@ module NatsWave
|
|
1315
1315
|
|
1316
1316
|
# Then call custom handler if provided (optional)
|
1317
1317
|
if config[:custom_handler]
|
1318
|
-
NatsWave.logger.debug "⚙️Calling custom publishing handler after publishing"
|
1318
|
+
NatsWave.logger.debug "⚙️ Calling custom publishing handler after publishing"
|
1319
1319
|
config[:custom_handler].call(self.class.name, action, processed_data, self)
|
1320
1320
|
end
|
1321
1321
|
end
|
@@ -18,7 +18,7 @@ module NatsWave
|
|
18
18
|
def initialize(options = {})
|
19
19
|
@nats_url = ENV['NATS_URL'] || "nats://localhost:4222"
|
20
20
|
@service_name = ENV['NATS_SERVICE_NAME'] || "purplewave"
|
21
|
-
@version = ENV['NATS_SERVICE_VERSION'] || "1.1.
|
21
|
+
@version = ENV['NATS_SERVICE_VERSION'] || "1.1.17"
|
22
22
|
@instance_id = ENV['NATS_INSTANCE_ID'] || Socket.gethostname
|
23
23
|
@database_url = ENV['NATS_DATABASE_URL'] || nil
|
24
24
|
@connection_pool_size = (ENV['NATS_CONNECTION_POOL_SIZE'] || 10).to_i
|
data/lib/nats_wave/version.rb
CHANGED