如何解决Spring Boot Camel ActiveMQ apache geronimo 漏洞
我在 Spring Boot 中使用 Camel 使用 camel-jms-starter
、artemis-jms-client
和 camel-jms
将消息发送到 ActiveMQ Artemis 队列。问题是 Jenkins 在嵌套依赖项 org.apache.geronimo.specs:geronimo-jms_2.0_spec
中发现了漏洞。
如果我排除它,它将不起作用。
有没有办法在 Spring Boot 中继续使用 Camel 在没有 Apache Geronimo JMS 的情况下在 ActiveMQ 队列中发送消息?
这些是我对 ActiveMQ 的 Camel 依赖项:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms-starter</artifactId>
<version>${camel.version}</version>
</dependency>
我不使用任何配置 bean,因为 Spring Boot 通过属性自动执行
spring.artemis.mode=native
spring.artemis.host=localhost
spring.artemis.port=61616
spring.artemis.user=admin
spring.artemis.password=admin
解决方法
您可以从 artemis-jms-client
中明确排除 Apache Geronimo 依赖项,例如:
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
然后您可以添加对 Eclipse JMS API 实现的依赖,例如:
<dependency>
<groupId>jakarta.jms</groupId>
<artifactId>jakarta.jms-api</artifactId>
<version>2.0.3</version>
</dependency>
也就是说,Apache Geronimo JMS API 被标记为带有漏洞是非常奇怪的,因为它只是一个 API。换句话说,它只是 Java interface
和空的 class
定义。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。