[
https://issues.apache.org/jira/browse/CAMEL-12493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16473949#comment-16473949
]
ASF GitHub Bot commented on CAMEL-12493:
----------------------------------------
oscerd closed pull request #2338: CAMEL-12493:make type converters and its
required dependencies optional
URL: https://github.com/apache/camel/pull/2338
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/components/camel-hl7/pom.xml b/components/camel-hl7/pom.xml
index be36db6b8a4..15efde9b212 100644
--- a/components/camel-hl7/pom.xml
+++ b/components/camel-hl7/pom.xml
@@ -57,42 +57,49 @@
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v21</artifactId>
<version>${hapi-version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v22</artifactId>
<version>${hapi-version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v23</artifactId>
<version>${hapi-version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v231</artifactId>
<version>${hapi-version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v24</artifactId>
<version>${hapi-version}</version>
-
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v25</artifactId>
<version>${hapi-version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v251</artifactId>
<version>${hapi-version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v26</artifactId>
<version>${hapi-version}</version>
+ <optional>true</optional>
</dependency>
<!-- for MLLP either use mina2 or camel-netty4 -->
@@ -101,7 +108,6 @@
<artifactId>mina-core</artifactId>
<optional>true</optional>
</dependency>
-
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-netty4</artifactId>
diff --git
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL721Converter.java
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL721Converter.java
index 27578a63379..5adb24debe4 100644
---
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL721Converter.java
+++
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL721Converter.java
@@ -78,7 +78,7 @@
/**
* HL7 converters.
*/
-@Converter
+@Converter(ignoreOnLoadError = true)
public final class HL721Converter {
private static final HapiContext DEFAULT_CONTEXT;
diff --git
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL722Converter.java
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL722Converter.java
index 336d8adf564..f2d6863cc14 100644
---
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL722Converter.java
+++
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL722Converter.java
@@ -110,7 +110,7 @@
/**
* HL7 converters.
*/
-@Converter
+@Converter(ignoreOnLoadError = true)
public final class HL722Converter {
private static final HapiContext DEFAULT_CONTEXT;
diff --git
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7231Converter.java
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7231Converter.java
index f4a776cfa6c..bbe3b1695d9 100644
---
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7231Converter.java
+++
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7231Converter.java
@@ -211,7 +211,7 @@
/**
* HL7 converters.
*/
-@Converter
+@Converter(ignoreOnLoadError = true)
public final class HL7231Converter {
private static final HapiContext DEFAULT_CONTEXT;
diff --git
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL723Converter.java
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL723Converter.java
index 4deff435f56..9b9cf509cca 100644
---
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL723Converter.java
+++
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL723Converter.java
@@ -274,7 +274,7 @@
/**
* HL7 converters.
*/
-@Converter
+@Converter(ignoreOnLoadError = true)
public final class HL723Converter {
private static final HapiContext DEFAULT_CONTEXT;
diff --git
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL724Converter.java
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL724Converter.java
index bb174e932dd..02be6cadcd3 100644
---
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL724Converter.java
+++
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL724Converter.java
@@ -216,7 +216,7 @@
/**
* HL7 converters.
*/
-@Converter
+@Converter(ignoreOnLoadError = true)
public final class HL724Converter {
private static final HapiContext DEFAULT_CONTEXT;
diff --git
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7251Converter.java
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7251Converter.java
index ac7b08f8008..824bf622a3b 100644
---
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7251Converter.java
+++
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7251Converter.java
@@ -238,7 +238,7 @@
/**
* HL7 converters.
*/
-@Converter
+@Converter(ignoreOnLoadError = true)
public final class HL7251Converter {
private static final HapiContext DEFAULT_CONTEXT;
diff --git
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL725Converter.java
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL725Converter.java
index ce93b77aba4..8b825027bb4 100644
---
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL725Converter.java
+++
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL725Converter.java
@@ -238,7 +238,7 @@
/**
* HL7 converters.
*/
-@Converter
+@Converter(ignoreOnLoadError = true)
public final class HL725Converter {
private static final HapiContext DEFAULT_CONTEXT;
diff --git
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL726Converter.java
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL726Converter.java
index 19419d56473..f426d798df4 100644
---
a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL726Converter.java
+++
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL726Converter.java
@@ -253,7 +253,7 @@
/**
* HL7 converters.
*/
-@Converter
+@Converter(ignoreOnLoadError = true)
public final class HL726Converter {
private static final HapiContext DEFAULT_CONTEXT;
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Make additional HL7 Type Converters optional
> --------------------------------------------
>
> Key: CAMEL-12493
> URL: https://issues.apache.org/jira/browse/CAMEL-12493
> Project: Camel
> Issue Type: Improvement
> Components: camel-hl7
> Affects Versions: 2.21.0
> Reporter: christian ohr
> Priority: Major
> Fix For: 2.21.2, 2.22.0
>
>
> In Camel 2.21.0, HL7-version/event-specific type converters were added to
> camel-hl7. IMHO this was a bad idea:
> * it transitively pulls in *all* HL7 structure libraries, regardless whether
> you need them in your application or not. That's nearly 10MB. Btw, type
> converters for the newer HL7 versions 2.7, 2.8, 2.8.1 were simply
> disregarded, which would have gifted you with another ~ 7.5MB.
> * manually excluding one or more of them causes the
> AnnotationTypeConverterLoader to throw ugly NoClassDefFoundError stack traces
> in the log
> * the component documentation states that you have to manually add structure
> library dependencies (the way it should be, really)
> Proposal: remove these type converters. I think it's acceptable to do a
> simple type cast in a processor or add a manual \{{convertBodyTo(HL7Class)}}
> in the route instead.
> Opinions? (I'm happy to provide a PR :))
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)