Skip to content

Commit 4a8511d

Browse files
phipagKarthik Puttaswamy
andauthored
fix(kafka): Handle message indices in proto data also for Glue Schema Registry (#1907)
* Bug fix to handle message indices in proto data * Removing links and changing log level from info to debug * Upgrade lambda.events.version tp 3.16.0 * Update Glue schema id to 36. Add some tests to increase coverage. Use Kafka ByteUtils also in unit tests. * Update lambda java events to 3.16.0 everywhere. * Add sample generation code for all Protobuf cases. --------- Co-authored-by: Karthik Puttaswamy <[email protected]>
1 parent 8f70e83 commit 4a8511d

File tree

23 files changed

+433
-137
lines changed

23 files changed

+433
-137
lines changed

examples/powertools-examples-core-utilities/cdk/app/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<dependency>
4242
<groupId>com.amazonaws</groupId>
4343
<artifactId>aws-lambda-java-events</artifactId>
44-
<version>3.15.0</version>
44+
<version>3.16.0</version>
4545
</dependency>
4646
<dependency>
4747
<groupId>org.apache.logging.log4j</groupId>

examples/powertools-examples-core-utilities/gradle/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626
implementation 'com.amazonaws:aws-lambda-java-core:1.2.2'
2727
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.2'
2828
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.2.2'
29-
implementation 'com.amazonaws:aws-lambda-java-events:3.11.0'
29+
implementation 'com.amazonaws:aws-lambda-java-events:3.16.0'
3030
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.2'
3131
implementation 'org.aspectj:aspectjrt:1.9.20.1'
3232
aspect 'software.amazon.lambda:powertools-tracing:2.1.0'

examples/powertools-examples-core-utilities/kotlin/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies {
1212
implementation("com.amazonaws:aws-lambda-java-core:1.2.3")
1313
implementation("com.fasterxml.jackson.core:jackson-annotations:2.15.1")
1414
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.3")
15-
implementation("com.amazonaws:aws-lambda-java-events:3.11.3")
15+
implementation("com.amazonaws:aws-lambda-java-events:3.16.0")
1616
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.2")
1717
implementation("org.aspectj:aspectjrt:1.9.20.1")
1818
aspect("software.amazon.lambda:powertools-tracing:2.1.0")
@@ -23,4 +23,4 @@ dependencies {
2323

2424
kotlin {
2525
jvmToolchain(11)
26-
}
26+
}

examples/powertools-examples-core-utilities/sam-graalvm/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<dependency>
4040
<groupId>com.amazonaws</groupId>
4141
<artifactId>aws-lambda-java-events</artifactId>
42-
<version>3.11.3</version>
42+
<version>3.16.0</version>
4343
</dependency>
4444
<dependency>
4545
<groupId>org.aspectj</groupId>

examples/powertools-examples-core-utilities/sam/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<dependency>
3939
<groupId>com.amazonaws</groupId>
4040
<artifactId>aws-lambda-java-events</artifactId>
41-
<version>3.15.0</version>
41+
<version>3.16.0</version>
4242
</dependency>
4343
<dependency>
4444
<groupId>org.aspectj</groupId>

examples/powertools-examples-core-utilities/serverless/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<dependency>
3939
<groupId>com.amazonaws</groupId>
4040
<artifactId>aws-lambda-java-events</artifactId>
41-
<version>3.15.0</version>
41+
<version>3.16.0</version>
4242
</dependency>
4343
<dependency>
4444
<groupId>org.aspectj</groupId>

examples/powertools-examples-core-utilities/terraform/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<dependency>
3939
<groupId>com.amazonaws</groupId>
4040
<artifactId>aws-lambda-java-events</artifactId>
41-
<version>3.15.0</version>
41+
<version>3.16.0</version>
4242
</dependency>
4343
<dependency>
4444
<groupId>org.aspectj</groupId>

examples/powertools-examples-idempotency/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<dependency>
5353
<groupId>com.amazonaws</groupId>
5454
<artifactId>aws-lambda-java-events</artifactId>
55-
<version>3.15.0</version>
55+
<version>3.16.0</version>
5656
</dependency>
5757
<dependency>
5858
<groupId>org.aspectj</groupId>

examples/powertools-examples-kafka/events/kafka-protobuf-event.json

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030
{
3131
"headerKey": [104, 101, 97, 100, 101, 114, 86, 97, 108, 117, 101]
3232
}
33-
]
33+
],
34+
"valueSchemaMetadata": {
35+
"schemaId": "123",
36+
"dataFormat": "PROTOBUF"
37+
}
3438
},
3539
{
3640
"topic": "mytopic",
@@ -39,12 +43,34 @@
3943
"timestamp": 1545084650989,
4044
"timestampType": "CREATE_TIME",
4145
"key": null,
42-
"value": "AgEACOkHEgZMYXB0b3AZUrgehes/j0A=",
46+
"value": "BAIACOkHEgZMYXB0b3AZUrgehes/j0A=",
4347
"headers": [
4448
{
4549
"headerKey": [104, 101, 97, 100, 101, 114, 86, 97, 108, 117, 101]
4650
}
47-
]
51+
],
52+
"valueSchemaMetadata": {
53+
"schemaId": "456",
54+
"dataFormat": "PROTOBUF"
55+
}
56+
},
57+
{
58+
"topic": "mytopic",
59+
"partition": 0,
60+
"offset": 18,
61+
"timestamp": 1545084650990,
62+
"timestampType": "CREATE_TIME",
63+
"key": "NDI=",
64+
"value": "AQjpBxIGTGFwdG9wGVK4HoXrP49A",
65+
"headers": [
66+
{
67+
"headerKey": [104, 101, 97, 100, 101, 114, 86, 97, 108, 117, 101]
68+
}
69+
],
70+
"valueSchemaMetadata": {
71+
"schemaId": "12345678-1234-1234-1234-123456789012",
72+
"dataFormat": "PROTOBUF"
73+
}
4874
}
4975
]
5076
}

examples/powertools-examples-kafka/tools/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<maven.compiler.target>11</maven.compiler.target>
1414
<avro.version>1.12.0</avro.version>
1515
<protobuf.version>4.31.0</protobuf.version>
16+
<kafka-clients.version>4.0.0</kafka-clients.version>
1617
</properties>
1718

1819
<dependencies>
@@ -26,6 +27,11 @@
2627
<artifactId>protobuf-java</artifactId>
2728
<version>${protobuf.version}</version>
2829
</dependency>
30+
<dependency>
31+
<groupId>org.apache.kafka</groupId>
32+
<artifactId>kafka-clients</artifactId>
33+
<version>${kafka-clients.version}</version>
34+
</dependency>
2935
<dependency>
3036
<groupId>com.fasterxml.jackson.core</groupId>
3137
<artifactId>jackson-databind</artifactId>

0 commit comments

Comments
 (0)