Skip to content

Commit 32ecb93

Browse files
committed
Rename Artemis bq- AMQP properties to JMS-legal bq_ underscores
1 parent b5227e4 commit 32ecb93

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

src/BabelQueue.Artemis/AmqpProperties.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@ namespace BabelQueue.Artemis;
1010
/// Projects the envelope's contract fields onto the AMQP 1.0 message a JMS peer reads, and reads
1111
/// them back. Body = envelope JSON; <c>correlation-id</c> = <c>trace_id</c> (JMSCorrelationID);
1212
/// <c>creation-time</c> = <c>meta.created_at</c> (JMSTimestamp); the <c>x-opt-jms-type</c>
13-
/// message annotation = URN (JMSType, the AMQP-JMS mapping); plus the <c>bq-</c> application
14-
/// properties (string-valued, matching the Java JMS <c>setStringProperty</c> projection). A
15-
/// positive delay sets the <c>x-opt-delivery-time</c> annotation Artemis honours for scheduled
16-
/// delivery. The body stays authoritative (Contract §7.2).
13+
/// message annotation = URN (JMSType, the AMQP-JMS mapping); plus the <c>bq_</c> application
14+
/// properties (string-valued). The names use <strong>underscores</strong>, not hyphens: a JMS
15+
/// property name must be a valid Java identifier, and every Artemis SDK uses the same JMS-legal
16+
/// form for cross-protocol parity. A positive delay sets the <c>x-opt-delivery-time</c>
17+
/// annotation Artemis honours for scheduled delivery. The body stays authoritative (Contract §7.2).
1718
/// </summary>
1819
internal static class AmqpProperties
1920
{
20-
public const string SchemaVersion = "bq-schema-version";
21-
public const string SourceLang = "bq-source-lang";
22-
public const string Attempts = "bq-attempts";
23-
public const string AppId = "bq-app-id";
24-
public const string Delay = "bq-delay";
21+
public const string SchemaVersion = "bq_schema_version";
22+
public const string SourceLang = "bq_source_lang";
23+
public const string Attempts = "bq_attempts";
24+
public const string AppId = "bq_app_id";
25+
public const string Delay = "bq_delay";
2526
public const string AppIdValue = "babelqueue";
2627

2728
private static readonly Symbol JmsType = new("x-opt-jms-type");

tests/BabelQueue.Artemis.Tests/conformance/manifest.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,16 @@
177177
"artemis": {
178178
"description": "Apache ActiveMQ Artemis binding conformance (broker-bindings.md §7). Every SDK that ships an Artemis transport must satisfy these. The message body stays byte-identical (the 'cases' above); these lock the AMQP-1.0 projection + reconciliation the binding adds. Per-message values reuse fixtures/order-created.json so the expected projection is deterministic.",
179179
"property_projection": {
180-
"description": "On produce, the transport MUST project the envelope onto the AMQP a JMS peer reads: the x-opt-jms-type message annotation = job (the URN, the AMQP-JMS mapping of JMSType), correlation-id = trace_id (JMSCorrelationID), creation-time = meta.created_at (JMSTimestamp, Unix ms), plus the bq- application properties, all string-valued (matching the Java JMS setStringProperty projection): bq-schema-version = str(meta.schema_version), bq-source-lang = meta.lang, bq-attempts = str(attempts), bq-app-id = 'babelqueue'. The body is the byte-identical envelope. Unlike Kafka/Pulsar, the URN / trace_id / message-id are NOT bq- properties — they ride the JMS-native slots. Applies to every Artemis-producing SDK.",
180+
"description": "On produce, the transport MUST project the envelope onto the AMQP a JMS peer reads: the x-opt-jms-type message annotation = job (the URN, the AMQP-JMS mapping of JMSType), correlation-id = trace_id (JMSCorrelationID), creation-time = meta.created_at (JMSTimestamp, Unix ms), plus the bq_ application properties, all string-valued. The names use UNDERSCORES (bq_schema_version, not bq-schema-version): JMS property names must be valid Java identifiers (no hyphens), and the Java binding consumes/produces over JMS, so every Artemis SDK uses the JMS-legal underscore form for cross-protocol parity. bq_schema_version = str(meta.schema_version), bq_source_lang = meta.lang, bq_attempts = str(attempts), bq_app_id = 'babelqueue'. The body is the byte-identical envelope. Unlike Kafka/Pulsar, the URN / trace_id / message-id are NOT bq_ properties — they ride the JMS-native slots. Applies to every Artemis-producing SDK.",
181181
"envelope_file": "fixtures/order-created.json",
182182
"jms_type_annotation": "x-opt-jms-type",
183183
"jms_type": "urn:babel:orders:created",
184184
"correlation_id": "7b3f9c2a-e41d-4f88-9b2a-1c0d5e6f7a8b",
185185
"properties": {
186-
"bq-schema-version": "1",
187-
"bq-source-lang": "php",
188-
"bq-attempts": "0",
189-
"bq-app-id": "babelqueue"
186+
"bq_schema_version": "1",
187+
"bq_source_lang": "php",
188+
"bq_attempts": "0",
189+
"bq_app_id": "babelqueue"
190190
}
191191
},
192192
"attempts_reconciliation": {

0 commit comments

Comments
 (0)