You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/11/09 12:53:13 UTC

[GitHub] [camel-quarkus] JiriOndrusek opened a new pull request #2001: [Camel 3.7] JSON-B data format support

JiriOndrusek opened a new pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001


   fixes https://github.com/apache/camel-quarkus/issues/1973
   
   Camel dataformat for json-b doesn't contain implementation for jsonb. As you can see in `configuration.adoc` and in a test module, I've used johnzon implementation of jsonb.
   
   @ppalaga I can imagine also creation of jsonb extension containing johnzon implementation - which would be easier to use (without reflection configuration). What do you think?
   
   [ ] An issue should be filed for the change unless this is a trivial change (fixing a typo or similar). One issue should ideally be fixed by not more than one commit and the other way round, each commit should fix just one issue, without pulling in other changes.
   [ ] Each commit in the pull request should have a meaningful and properly spelled subject line and body. Copying the title of the associated issue is typically enough. Please include the issue number in the commit message prefixed by #.
   [ ] The pull request description should explain what the pull request does, how, and why. If the info is available in the associated issue or some other external document, a link is enough.
   [ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close the named issue upon merging the pull request. Using them is typically a good idea.
   [ ] Please run mvn process-resources -Pformat (and amend the changes if necessary) before sending the pull request.
   [ ] Contributor guide is your good friend: https://camel.apache.org/camel-quarkus/latest/contributor-guide.html


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #2001: [Camel 3.7] JSON-B data format support

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001#discussion_r521172396



##########
File path: integration-tests/jsonb/pom.xml
##########
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-integration-tests</artifactId>
+        <version>1.4.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-integration-test-jsonb</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: JSON JSON-B</name>
+    <description>Integration tests for Camel Quarkus JSON JSON-B extension</description>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-bom-test</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-jsonb</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-direct</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy-jackson</artifactId>
+        </dependency>
+
+        <!-- test dependencies -->
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-junit5</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.rest-assured</groupId>
+            <artifactId>rest-assured</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+
+        <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-direct-deployment</artifactId>
+            <version>${project.version}</version>
+            <type>pom</type>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>*</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->

Review comment:
       Thanks, I missed that - it is fixed now.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton merged pull request #2001: [Camel 3.7] JSON-B data format support

Posted by GitBox <gi...@apache.org>.
jamesnetherton merged pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek edited a comment on pull request #2001: [Camel 3.7] JSON-B data format support

Posted by GitBox <gi...@apache.org>.
JiriOndrusek edited a comment on pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001#issuecomment-724606425


   @jamesnetherton  I agree with you. `camel-jsonb` which this extension is for is using geronimo_spec, so excluding geronimo didn't come to my mind. 
   
   But from my POV geronimo should be removed from `camel-jsonb`, which will allow `yasson`. Then similarly as here (https://www.codeflow.site/de/article/java-json-binding-api) yasson could be used (without need of any exclusion) or johnzon (but with addition of geronimo spec)
   
   I've tested it locally and without geronimo we can use yasson. So there is only a question, whether we want
   
   1. exlude geronimo with yasson
   2. or include geronimo with johnzon
   
    edited 
   (option -1- 2 seems to be more usual from my POV)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on pull request #2001: [Camel 3.7] JSON-B data format support

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001#issuecomment-724198106


   > I can imagine also creation of jsonb extension containing johnzon implementation - which would be easier to use (without reflection configuration). What do you think?
   
   Can we not use `quarkus-jsonb`?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #2001: [Camel 3.7] JSON-B data format support

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001#issuecomment-724614721


   Do not merge this PR please, several changes will be done.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek edited a comment on pull request #2001: [Camel 3.7] JSON-B data format support

Posted by GitBox <gi...@apache.org>.
JiriOndrusek edited a comment on pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001#issuecomment-724606425


   @jamesnetherton  I agree with you. `camel-jsonb` which this extension is for is using geronimo_spec, so excluding geronimo didn't come to my mind. 
   
   But from my POV geronimo should be removed from `camel-jsonb`, which will allow `yasson`. Then similarly as here (https://www.codeflow.site/de/article/java-json-binding-api) yasson could be used (without need of any exclusion) or johnzon (but with addition of geronimo spec)
   
   I've tested it locally and without geronimo we can use yasson. So there is only a question, whether we want
   
   1. exlude geronimo with yasson
   2. or include geronimo with johnzon
   
    edited 
   (**option 2** seems to be more usual from my POV)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #2001: [Camel 3.7] JSON-B data format support

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001#issuecomment-724606425


   @jamesnetherton  I agree with you. `camel-jsonb` which this extension is for is using geronimo_spec, so excluding geronimo didn't come to my mind. 
   
   But from my POV geronimo should be removed from `camel-jsonb`, which will allow `yasson`. Then similarly as here (https://www.codeflow.site/de/article/java-json-binding-api) yasson could be used (without need of any exclusion) or johnzon (but with addition of geronimo spec)
   
   I've tested it locally and without geronimo we can use yasson. So there is only a question, whether we want
   
   1. exlude geronimo with yasson
   2. or include geronimo with johnzon
   
   (option 1 seems to be more usual from my POV)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #2001: [Camel 3.7] JSON-B data format support

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001#issuecomment-724659467


   Dependency `io.quarkus:quarkus-jsonb` is added to the extension, so no configuration is required from users.
   
   PR could be merged.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on pull request #2001: [Camel 3.7] JSON-B data format support

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001#issuecomment-724598502


   But aren't they both implementations of JSR-367? So plugging either library in should work so long as they both conform to the spec(s).
   
   Couldn't we exclude the `geronimo` bits and use `quarkus-jsonb`? Or am I missing something?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek edited a comment on pull request #2001: [Camel 3.7] JSON-B data format support

Posted by GitBox <gi...@apache.org>.
JiriOndrusek edited a comment on pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001#issuecomment-724614721


   Do not merge this PR please, several changes will be mode.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on a change in pull request #2001: [Camel 3.7] JSON-B data format support

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on a change in pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001#discussion_r521162679



##########
File path: integration-tests/jsonb/pom.xml
##########
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-integration-tests</artifactId>
+        <version>1.4.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-integration-test-jsonb</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: JSON JSON-B</name>
+    <description>Integration tests for Camel Quarkus JSON JSON-B extension</description>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-bom-test</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-jsonb</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-direct</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy-jackson</artifactId>
+        </dependency>
+
+        <!-- test dependencies -->
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-junit5</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.rest-assured</groupId>
+            <artifactId>rest-assured</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+
+        <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-direct-deployment</artifactId>
+            <version>${project.version}</version>
+            <type>pom</type>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>*</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->

Review comment:
       Just one little nit - can you remove the duplicated comment.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #2001: [Camel 3.7] JSON-B data format support

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #2001:
URL: https://github.com/apache/camel-quarkus/pull/2001#issuecomment-724590191


   @jamesnetherton Unfortunatelly using `quarkus-jsonb` is not a solution. `Camel-jsonb` is based on geronimo_spec (which is by the way using Johnzon as default implementation, see https://github.com/apache/geronimo-specs/blob/trunk/geronimo-jsonb_1.0_spec/src/main/java/javax/json/bind/spi/JsonbProvider.java#L30).
   
    `Quarkus-jsonb` is using `yasson` (see https://github.com/quarkusio/quarkus/blob/master/extensions/jsonb/runtime/pom.xml#L19). Yasson implements `javax.json.bind:javax.json.bind-api` not `org.apache.geronimo.specs:geronimo-jsonb_1.0_spec`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org