我尝试运行两个心轴:
./mvnw package -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3.2.0-Final-java11
Run Code Online (Sandbox Code Playgroud)
和 GraalVM 版本:
./mvnw package -Pnative -Dquarkus.native.container-build=true
Run Code Online (Sandbox Code Playgroud)
但他们只是卡在构建上,我有 M1 的最新 Docker,这是来自 mandrel 的示例,它只是使用 300% cpu 停留在那里:
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] docker run -v lambda-0.0.1-SNAPSHOT-native-image-source-jar:/project:z --env LANG=C --rm quay.io/quarkus/ubi-quarkus-mandrel:20.3.2.0-Final-java11 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dcom.mysql.cj.disableAbandonedConnectionCleanup=true -J-DCoordinatorEnvironmentBean.transactionStatusManagerEnable=false -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 -J-Duser.language=en -J-Dfile.encoding=UTF-8 --report-unsupported-elements-at-runtime --enable-all-security-services --allow-incomplete-classpath -H:DynamicProxyConfigurationFiles=dynamic-proxies.json -H:ResourceConfigurationFiles=resources-config.json -H:ReflectionConfigurationFiles=reflection-config.json --initialize-at-run-time=com.common.utils -H:+ReportExceptionStackTraces --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -jar lambda-0.0.1-SNAPSHOT-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:+AddAllCharsets -H:EnableURLProtocols=http,https --enable-all-security-services -H:-UseServiceLoaderFeature -H:+StackTrace lambda-0.0.1-SNAPSHOT-runner
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform …Run Code Online (Sandbox Code Playgroud) 我需要为ActiveMQ创建一个主题和一个持久订阅者,我的问题是我不知道在哪里指定。我可以创建主题并使用消息,但是当我关闭订阅服务器然后继续发送消息并再次打开订阅服务器时,它将无法读取它们。
这是我到目前为止的内容:
发送消息:
JmsTemplate jmsTemplate = context.getBean(JmsTemplate.class);
jmsTemplate.setPubSubDomain(true);
jmsTemplate.setDeliveryMode(DeliveryMode.PERSISTENT);
jmsTemplate.setDeliveryPersistent(true);
jmsTemplate.convertAndSend("venta.topic",venta);
Run Code Online (Sandbox Code Playgroud)
收到消息:
@JmsListener(destination = "venta.topic",id = "comercial",subscription = "venta.topic")
public void receiveMessage(Venta venta) {
logger.log(Level.INFO, "RECEIVED : {0}",venta);
repository.save(venta);
}
Run Code Online (Sandbox Code Playgroud)
我已经阅读了这篇文章,并且我了解我需要创建持久订阅者。
我还阅读了Spring文档
而且我认为这与DefaultJmsListenerContainerFactory(我没有实现,我使用的是默认配置)有关,文档显示:
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
DefaultJmsListenerContainerFactory factory =
new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(connectionFactory());
factory.setDestinationResolver(destinationResolver());
factory.setConcurrency("3-10");
return factory;
}
Run Code Online (Sandbox Code Playgroud)
但是我似乎找不到在哪里创建持久会话。生产者和订户都连接到独立的activemq二进制文件。
希望您能帮助我,在此先感谢。