Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix #182] Update to 3.0 version #185

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<packaging>pom</packaging>
<name>Quarkus - AsyncAPI Root</name>
<modules>
<!--TODO re-add module as soon as updated to AsyncAPI v3-->
<!--<module>quarkus-asyncapi</module>-->
<module>quarkus-asyncapi</module>
<module>quarkus-asyncapi-scanner</module>
<module>quarkus-asyncapi-common</module>
<module>docs</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import org.eclipse.microprofile.config.Config;

import com.asyncapi.v2._6_0.model.AsyncAPI;
import com.asyncapi.v3._0_0.model.AsyncAPI;

import io.quarkiverse.asyncapi.config.AsyncAPISupplier;
import io.quarkiverse.asyncapi.config.AsyncAPIUtils;
Expand Down
81 changes: 48 additions & 33 deletions quarkus-asyncapi/deployment/src/test/resources/asyncapi.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,66 @@
asyncapi: '2.0.0'
asyncapi: 3.0.0
id: 'urn:com:kafka:server'
info:
title: Kafka Application
version: '1.0.0'
version: 1.0.0
description: Kafka Application
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0'
servers:
production:
url: localhost:9092
description: Development server
host: 'localhost:9092'
protocol: kafka
protocolVersion: '1.0.0'
protocolVersion: 1.0.0
description: Development server
x-trigger-version: v0.9.1-0.20190603184501-d845e1d612f8
x-activity-version: v0.9.1-0.20190603184501-d845e1d612f8
channels:
/message:
description: A message channel
subscribe:
summary: Get messages
message:
message:
address: message
messages:
publish.message:
$ref: '#/components/messages/message'
traits:
- bindings:
flogo-kafka:
partitions: "0"
offset: 0
publish:
summary: Send messages
message:
subscribe.message:
$ref: '#/components/messages/message'
traits:
- bindings:
flogo-kafka:
partitions: "0"
offset: 0
/dup:
description: A duplicate message channel
subscribe:
summary: Get messages
message:
description: A message channel
dup:
address: /dup
messages:
publish.message:
$ref: '#/components/messages/message'
publish:
summary: Send messages
message:
subscribe.message:
$ref: '#/components/messages/message'
description: A duplicate message channel
operations:
/message.publish:
action: send
channel:
$ref: '#/channels/message'
summary: Send messages
messages:
- $ref: '#/channels/message/messages/publish.message'
/message.subscribe:
action: receive
channel:
$ref: '#/channels/message'
summary: Get messages
messages:
- $ref: '#/channels/~1message/messages/subscribe.message'
/dup.publish:
action: send
channel:
$ref: '#/channels/dup'
summary: Send messages
messages:
- $ref: '#/channels/dup/messages/publish.message'
/dup.subscribe:
action: receive
channel:
$ref: '#/channels/dup'
summary: Get messages
messages:
- $ref: '#/channels/dup/messages/subscribe.message'
components:
messages:
message:
Expand All @@ -54,7 +69,7 @@ components:
summary: A message
contentType: application/json
payload:
$ref: "#/components/schemas/message"
$ref: '#/components/schemas/message'
schemas:
message:
type: object
Original file line number Diff line number Diff line change
@@ -1,46 +1,54 @@
asyncapi: '2.0.0'
asyncapi: 3.0.0
id: 'urn:com:http:server'
info:
title: Http Application
version: '1.0.0'
version: 1.0.0
description: Http Application
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0'
servers:
production:
url: localhost:8080
description: Development server
host: 'localhost:8080'
protocol: http
description: Development server
channels:
first:
description: A message channel
subscribe:
summary: Get messages
message:
address: first
messages:
publish.message:
$ref: '#/components/messages/message'
publish:
summary: Send messages
message:
subscribe.message:
$ref: '#/components/messages/message'
traits:
- bindings:
flogo-kafka:
partitions: "0"
offset: 0
description: A message channel
operations:
first.publish:
action: send
channel:
$ref: '#/channels/first'
summary: Send messages
messages:
- $ref: '#/channels/first/messages/publish.message'
first.subscribe:
action: receive
channel:
$ref: '#/channels/first'
summary: Get messages
messages:
- $ref: '#/channels/first/messages/subscribe.message'
components:
messages:
message:
name: message
summary: A message
contentType: application/json
payload:
$ref: "#/components/schemas/message"
$ref: '#/components/schemas/message'
schemas:
message:
type: object
properties:
name:
name:
type: string
age:
type: integer
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
asyncapi: '2.0.0'
asyncapi: 3.0.0
id: 'urn:com:kafka:server'
info:
title: Kafka Application
version: '1.0.0'
version: 1.0.0
description: Kafka Application
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0'
servers:
production:
url: localhost:9092
description: Development server
host: 'localhost:9092'
protocol: kafka
protocolVersion: '1.0.0'
protocolVersion: 1.0.0
description: Development server
x-trigger-version: v0.9.1-0.20190603184501-d845e1d612f8
x-activity-version: v0.9.1-0.20190603184501-d845e1d612f8
channels:
/message:
description: A message channel
subscribe:
summary: Get messages
message:
message:
address: message
messages:
publish.message:
$ref: '#/components/messages/message'
traits:
- bindings:
flogo-kafka:
partitions: "0"
offset: 0
publish:
summary: Send messages
message:
subscribe.message:
$ref: '#/components/messages/message'
traits:
- bindings:
flogo-kafka:
partitions: "0"
offset: 0
description: A message channel
operations:
/message.publish:
action: receive
channel:
$ref: '#/channels/message'
summary: Send messages

messages:
- $ref: '#/channels/message/messages/publish.message'
/message.subscribe:
action: send
channel:
$ref: '#/channels/message'
summary: Get messages
messages:
- $ref: '#/channels/~1message/messages/subscribe.message'
components:
messages:
message:
name: message
summary: A message
contentType: application/json
payload:
$ref: "#/components/schemas/message"
$ref: '#/components/schemas/message'
schemas:
message:
type: object
properties:
name:
name:
type: string
age:
type: integer
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.junit.jupiter.api.Test;

import com.asyncapi.v2._6_0.model.AsyncAPI;
import com.asyncapi.v3._0_0.model.AsyncAPI;

import io.quarkus.test.junit.QuarkusTest;

Expand All @@ -19,10 +19,10 @@ public class AsyncAPIResourceGeneratorTest {
@Inject
AsyncAPIRegistry registry;

@ConfigProperty(name = "mp.messaging.incoming./message.connector")
@ConfigProperty(name = "mp.messaging.incoming.message.connector")
Optional<String> kafkaIncomingConnector;

@ConfigProperty(name = "mp.messaging.outgoing./message_out.connector")
@ConfigProperty(name = "mp.messaging.outgoing.message_out.connector")
Optional<String> kafkaOutgoingConnector;

@ConfigProperty(name = "mp.messaging.incoming.first.connector")
Expand All @@ -31,10 +31,10 @@ public class AsyncAPIResourceGeneratorTest {
@ConfigProperty(name = "mp.messaging.outgoing.first_out.connector")
Optional<String> httpOutgoingConnector;

@ConfigProperty(name = "mp.messaging.incoming./message.topic")
@ConfigProperty(name = "mp.messaging.incoming.message.topic")
Optional<String> incomingTopic;

@ConfigProperty(name = "mp.messaging.outgoing./message_out.topic")
@ConfigProperty(name = "mp.messaging.outgoing.message_out.topic")
Optional<String> outgoingTopic;

@ConfigProperty(name = "mp.messaging.incoming.first.path")
Expand All @@ -50,8 +50,8 @@ void testKafkaGenerator() {
assertThat(asyncAPI.get().getId()).isEqualTo("urn:com:kafka:server");
assertThat(kafkaIncomingConnector.get()).isEqualTo("smallrye-kafka");
assertThat(kafkaOutgoingConnector.get()).isEqualTo("smallrye-kafka");
assertThat(incomingTopic.get()).isEqualTo("/message");
assertThat(outgoingTopic.get()).isEqualTo("/message");
assertThat(incomingTopic.get()).isEqualTo("message");
assertThat(outgoingTopic.get()).isEqualTo("message");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Optional;

import com.asyncapi.v2._6_0.model.AsyncAPI;
import com.asyncapi.v3._0_0.model.AsyncAPI;

/** Holder of Async API instances */
public interface AsyncAPIRegistry {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.quarkiverse.asyncapi.config;

import com.asyncapi.v2._6_0.model.AsyncAPI;
import com.asyncapi.v3._0_0.model.AsyncAPI;

public interface AsyncAPISupplier {
String id();
Expand Down
Loading
Loading