- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在创建一个简单的 Thorntail 服务,它将向远程 ActiveMQ 队列写入一条文本消息,并让 MDB 使用该消息。为了对此进行测试,我在本地 Docker 容器中运行了 ActiveMQ。我的 docker-compose.yml
文件的相关部分如下所示:
activemq:
image: webcenter/activemq
ports:
- 1883:1883
- 5672:5672
- 8161:8161
- 61613:61613
- 61614:61614
- 61616:61616
environment:
- ACTIVEMQ_CONFIG_NAME=holocron-mq
- ACTIVEMQ_CONFIG_DEFAULTACCOUNT=false
- ACTIVEMQ_ADMIN_LOGIN=mqadmin
- ACTIVEMQ_ADMIN_PASSWORD=password
- ACTIVEMQ_CONFIG_QUEUES_queue1=myqueue1
- ACTIVEMQ_CONFIG_SCHEDULERENABLED=true
- ACTIVEMQ_USERS_edgeproducer=password
- ACTIVEMQ_USERS_edgeconsumer=password
我的 Thorntail project-defaults.yml
文件已配置为使用此配置连接到此“远程”服务器:
swarm:
network:
socket-binding-groups:
standard-sockets:
outbound-socket-bindings:
remote-activemq-socket-binding:
remote-host: 127.0.0.1
remote-port: 61616
messaging-activemq:
servers:
default:
remote-connectors:
remote-activemq-connector:
socket-binding: remote-activemq-socket-binding
pooled-connection-factories:
remote-connection-factory:
user: edgeproducer
password: password
connectors:
- remote-activemq-connector
entries:
- 'java:/jms/remote-mq'
- 'java:/DefaultJMSConnectionFactory'
jms-queues:
session-tracking-queue:
entries:
entry: 'java:/jms/queue/testQueue'
我的 JAX-RS 服务具有以下 2 个 JMS 属性(最终)允许我写入队列:
@Inject
@JMSConnectionFactory("java:/jms/remote-mq")
private JMSContext jmsContext = null;
@Resource(mappedName = "java:/jms/queue/testQueue")
private Queue processingQueue = null;
最后,我的 MDB 具有以下注释以允许它从队列中读取:
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "java:/jms/queue/testQueue"),
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10") })
@ResourceAdapter("remote-connection-factory")
但是,当我启动 Thorntail uberjar 时,出现以下错误:
AMQ214031: Failed to decode buffer, disconnect immediately.: java.lang.IllegalStateException: java.lang.IllegalArgumentException: AMQ119032: Invalid type: 1
AMQ212037: Connection failure has been detected: java.lang.IllegalArgumentException: AMQ119032: Invalid type: 1 [code=GENERIC_EXCEPTION]
我不确定我的配置中到底遗漏了什么导致了这个问题。任何人都可以阐明我做错了什么吗?
最佳答案
您正在尝试将 ActiveMQ Artemis“核心”JMS 客户端(即 Thorntail 中的默认 JMS 客户端实现)与 ActiveMQ 5.x 代理一起使用。 ActiveMQ Artemis 是下一代 ActiveMQ 消息代理,Artemis 核心 JMS 客户端无法与 5.x 代理通信。我建议您在 Docker 容器中使用 ActiveMQ Artemis。它向后兼容 5.x 代理支持的 OpenWire JMS 客户端实现,它还支持所有其他协议(protocol)(例如 AMQP、STOMP、MQTT)。
关于java - Thorntail JMS 到远程 ActiveMQ 服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56174631/
我还在学习,这是我第一次写后端。有一个限制,我必须使用Thorntail。我对此了解不多。 Thorntail Project Generator有一个可用依赖项的列表,但我看到的教程使用 Maven
我的 Maven 项目遇到问题。我正在尝试使用命令“mvn clean install”,但没有成功。我已经在 Eclipse IDE 中更新并清理了 Maven 项目。我还删除了“.m2”目录中的文
我正在 Thorntail 中编写一个计划任务,该任务将运行很长时间(大约 30 分钟)。然而,Thorntail 似乎将执行时间限制为 30 秒。 我的代码如下所示(我删除了我认为不相关的代码):
我使用 Thorntail Project Generator 创建了一个新项目。我想提供少量静态文件,例如 html、图像等 我该怎么做? 最佳答案 假设您使用 Maven 构建项目,您需要: 确保
我需要将 Wildfly-Thorntail 从 2.2 升级到 2.3,以解决与 Maven 3.6 的兼容性问题。在 Maven 3.5 和 2.2 下,该项目可以完美构建和运行,但在 3.6 下
尝试打包 thorntail-examples project 时在 github 上,构建在几个示例中失败,指出与此类似的 API 不兼容错误... [ERROR] Failed to execut
您能否提供Quarkus之间更详细的区别?和 Thorntail ? 这有助于在构建新的“Java 云原生应用”时在这两者之间进行考虑。 最佳答案 Quarkus 对 Thorntail 的看法: 能
我刚刚开始使用 Thorntail,并尝试做最简单的测试。我编写了一个仅返回成功状态的 HealthCheck 实现。就这样。然而,当我运行 mvn thorntail:run 时,我收到一条错误消息
这个问题是关于以可移植的方式读取 REST 服务中的配置的正确方法,例如应在 Thorntail 2.4.0 和 Wildfly 15 上运行。 这是 Thorntail 建议的原始实现 @Injec
我正在启动一个 Thorntail 空心 jar 并传入 --properties=environment.properties。该文件包含一个带有 ${...} 表达式的属性,该表达式并不供 Tho
我的 JavaEE 应用程序有问题,我尝试创建将自动部署的应用程序,所以我选择了 Thorntail,但在使用 mvn thorntail:run 启动它后,我'我收到了这个错误信息 Exceptio
我有几个使用 Thorntail 框架开发的微服务项目。我正在使用 Eclipse 编写代码。过去,我使用 Wildfly 应用程序服务器完成了所有开发工作,而 Eclipse 使调试这些应用程序变得
我正在创建一个简单的 Thorntail 服务,它将向远程 ActiveMQ 队列写入一条文本消息,并让 MDB 使用该消息。为了对此进行测试,我在本地 Docker 容器中运行了 ActiveMQ。
我有一个关于在 Thorntail 上配置 JMS 的小问题。在我的开发项目中,我使用 Wildfly,但对于远程服务器,我们使用(我的团队)IBM Portal。我将本地服务器从 Wildfly 升
如何使用项目默认 yaml 配置消息传递 activemq - thorntail 或 swarm 我目前遇到以下异常 资源“/subsystem=messaging-activemq/connect
我们目前将项目中的 Thorntail 版本从 2.5.0.Final 更新到 2.6.0.Final。 Caused by: org.eclipse.aether.transfer.Artifact
我在 docker 容器中运行 Spring Boot 和 Keycloak 时遇到问题。 我开始使用 Keycloak,mysql 作为 db 在 docker 中运行。 services: m
我开始使用thorntail V4 (www.thorntail.io)(以前称为wildfly swarm)来创建微服务。是的,我知道该网站将其称为“概念证明”。 Thorntail 附带 Unde
我正在尝试使用 @ConfigurationValue ,它应该从 project-defaults.yml 读取值,但是,我遇到了奇怪的行为,请参阅下面的代码。 我的 Controller : @A
我在通过从 Keycloak 收到的不记名 token 授权用户时遇到问题。 任务是将来自 Angular 应用程序的用户请求授权给我的后端 Thorntail 2.5.0.Final 微服务。我已经
我是一名优秀的程序员,十分优秀!