-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add specialized ProducerData classes for Kafka and AMQP
- Loading branch information
1 parent
07c7690
commit 471ebdb
Showing
14 changed files
with
93 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ plugins { | |
} | ||
|
||
sourceCompatibility = '1.8' | ||
version '0.5.0' | ||
version '0.6.0' | ||
|
||
|
||
repositories { | ||
|
2 changes: 1 addition & 1 deletion
2
springwolf-examples/springwolf-kafka-example/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...plugin/src/main/java/io/github/stavshamir/springwolf/asyncapi/types/AmqpProducerData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.github.stavshamir.springwolf.asyncapi.types; | ||
|
||
import com.asyncapi.v2.binding.amqp.AMQPChannelBinding; | ||
import com.asyncapi.v2.binding.amqp.AMQPOperationBinding; | ||
import com.google.common.collect.ImmutableMap; | ||
import lombok.Builder; | ||
|
||
import java.util.Collections; | ||
|
||
public class AmqpProducerData extends ProducerData { | ||
|
||
@Builder(builderMethodName = "amqpProducerDataBuilder") | ||
public AmqpProducerData(String queueName, String exchangeName, String routingKey, Class<?> payloadType) { | ||
this.channelName = queueName; | ||
|
||
AMQPChannelBinding.ExchangeProperties exchangeProperties = new AMQPChannelBinding.ExchangeProperties(); | ||
exchangeProperties.setName(exchangeName); | ||
this.channelBinding = ImmutableMap.of("amqp", AMQPChannelBinding.builder() | ||
.is("routingKey") | ||
.exchange(exchangeProperties) | ||
.build()); | ||
|
||
this.operationBinding = ImmutableMap.of("amqp", AMQPOperationBinding.builder() | ||
.cc(Collections.singletonList(routingKey)) | ||
.build()); | ||
|
||
this.payloadType = payloadType; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...lugin/src/main/java/io/github/stavshamir/springwolf/asyncapi/types/KafkaProducerData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.github.stavshamir.springwolf.asyncapi.types; | ||
|
||
import com.asyncapi.v2.binding.kafka.KafkaChannelBinding; | ||
import com.asyncapi.v2.binding.kafka.KafkaOperationBinding; | ||
import com.google.common.collect.ImmutableMap; | ||
import lombok.Builder; | ||
|
||
public class KafkaProducerData extends ProducerData { | ||
|
||
@Builder(builderMethodName = "kafkaProducerDataBuilder") | ||
public KafkaProducerData(String topicName, Class<?> payloadType) { | ||
this.channelName = topicName; | ||
this.channelBinding = ImmutableMap.of("kafka", new KafkaChannelBinding()); | ||
this.payloadType = payloadType; | ||
this.operationBinding = ImmutableMap.of("kafka", new KafkaOperationBinding()); | ||
} | ||
|
||
} |