Доступ Quarkus к удаленным ресурсам

все, у меня есть приложение, которое мы переключаем на кваркус. До сих пор я мог выполнять удаленный поиск через JNDI в очереди JMS в веб-логике. Но похоже, что Quarkus больше не поддерживает JNDI.

Итак, мой вопрос: как мне выполнить поиск в удаленной очереди в WLS? Мой старый код был таким

  Hashtable<String, String> env = new Hashtable();
  env.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
  env.put("java.naming.provider.url", url);
  InitialContext context = new InitialContext(env);
  ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup(jmsConnectionFactory);
  Destination destination = (Destination) context.lookup(jmsDestination);
  connection = connectionFactory.createConnection();

  session = connection.createSession(true, 1);
  sender = session.createProducer(destination);

person Lorenzo Dimitri Bono    schedule 11.07.2020    source источник


Ответы (2)


Quarkus действительно не поддерживает JNDI.

JMS можно использовать через расширение Quarkus QPid. Вы можете прочитать документацию здесь и просмотреть приложение для быстрого запуска здесь.

person geoand    schedule 11.07.2020
comment
2020-07-13 12: 31: 56,192 ОШИБКА [org.apa.qpi.jms.pro.ProviderFactory] (main) Не удалось создать экземпляр провайдера для t3 из-за: {}: java.io.IOException: схема провайдера НЕ распознано: [t3] в org.apache.qpid.jms.provider.ProviderFactory.findProviderFactory (ProviderFactory.java:156) в org.apache.qpid.jms.provider.ProviderFactory.findProviderFactory (ProviderFactory) в org:13 apache.qpid.jms.provider.ProviderFactory.create (ProviderFactory.java:102) в org.apache.qpid.jms.provider.ProviderFactory.create (ProviderFactory.java:82) в org.apache.qpid.jms.JmsConnectionFactory. createProvider (JmsConnectionFactory.java:349) в org.apache.qpid.jms.JmsConnectionFactory.createConnection (JmsConnectionFactory.java:208) в org.apache.qpid.jms.JmsConnectionFactory.createContext.jms.jmsConnectionFactory.createContext3: jmsConnectionFactory.createContext3: jmsConnectionFactory. .qpid.jms.JmsConnectionFactory.createContext (JmsConnectionFactory.java:320) в org.amqphub.quarkus.qpid.jms.runtime.QpidJmsProducer_ProducerMethod_connectionFactory_77384d97dd5fab 56fb7d89e045176235cbda65cd_ClientProxy.createContext (QpidJmsProducer_ProducerMethod_connectionFactory_77384d97dd5fab56fb7d89e045176235cbda65cd_ClientProxy.zig: 191) в ch.postfinance.taas.eai.jms.test.EaiJmsSenderTest.testUpload (EaiJmsSenderTest.java:86) при java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Родной метод ) в java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) в java.base / jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.invoke (DelegatingbImethodava.java: lang.reflect.Method.invoke (Method.java:566) в io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod (QuarkusTestExtension.java:547) в io.quarkus.test.junit.QuarkusTestExtension.javaTestd (QuarkusTestExtension.javaterceptd (QuarkusTestExtension.javaterceptd 455) в org.junit.jupiter.engine.execution.ExecutableInvoker $ ReflectiveInterceptorCall.lambda $ ofVoidMethod $ 0 (ExecutableInvoker.java:115) в org.junit.jupiter.engine.execution.ExecutableInvoker.lambda $ 0 (ExecutableInvoker.java:105) в org.junit.jupiter.engine.execution.InvocationInterceptorChain $ InterceptedInvocation.proceed (InvocationInterceptorChain.java:106) в org.junit.jupiter.engine.extension.Extension. 149) в org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod (TimeoutExtension.java:140) в org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod (TimeoutExtension.java:84) в org.jupit. .engine.execution. ExecutableInvoker $ ReflectiveInterceptorCall.lambda $ ofVoidMethod $ 0 (ExecutableInvoker.java:115) в org.junit.jupiter.engine.execution.ExecutableInvoker.lambda $ invokeiter $ 0 (ExecutableInvoker.javac.java. InvocationInterceptorChain $ InterceptedInvocation.proceed (InvocationInterceptorChain.java:106) в org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed (InvocationInterceptorChain.java:64) в org.CceptorChain.java:64) в org.CceptorChain. java: 45) в org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke (InvocationInterceptorChain.java:37) в org.junit.jupiter.engine.execution.ExecutableInvoker.invoke (ExecutableInv104.java) или .jupiter.engine.execution.ExecutableInvoker.invoke (ExecutableInvoker.java:98) по адресу org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda $ invokeTestMethod $ 6 (TestMethodTestDescript.gunit. поддерживать t.hierarchical.ThrowableCollector.execute (ThrowableCollector.java:73) по адресу org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod (TestMethodTestDescriptor.java:208) в org.junit.java:208 TestMethodTestDescriptor.java:137) по адресу org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute (TestMethodTestDescriptor.java:71) по адресу org.junit.platform.engine.support.hierarchical.javaTestDataSupport.hierarchical. : 135) в org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute (ThrowableCollector.java:73) в org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda $ executeRecursively $ 7 (NodeavaTest 125) на org.junit.platform.engine.support.hierarchical.Node.around (Node.java:135) на org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda $ executeRecursively $ 8 (NodeTestTask.java:123 ) в org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute ( ThrowableCollector.java:73) на org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively (NodeTestTask.java:122) на org.junit.platform.engine.support.hierarchical.NodeTestjavaTask.execute 80) в java.base / java.util.ArrayList.forEach (ArrayList.java:1540) в org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll (SameThreadHierarchicalTestExecutorService.invokeAll (SameThreadHierarchicalTestviceExecutorService. .engine.support.hierarchical. NodeTestTask.lambda $ executeRecursively $ 5 (NodeTestTask.java:139) в org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute (ThrowableCollector.javaText: 73) в org.junit.platform.hestical.support .lambda $ executeRecursively $ 7 (NodeTestTask.java:125) в org.junit.platform.engine.support.hierarchical.Node.around (Node.java:135) в org.junit.platform.engine.support.hierarchical.NodeTestTask. lambda $ executeRecursively $ 8 (NodeTestTask.java:123) в org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute (ThrowableCollector.java:73) в org.junit.platform.engine.support.Tierarchical.support.hierarchical.support.hierarchical.support.hierarchical.support.hierarchical. (NodeTestTask.java:122) в org.junit.platform.engine.support.hierarchical.NodeTestTask.execute (NodeTestTask.java:80) в java.base / java.util.ArrayList.forEach (ArrayList.java:1540) в org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll (SameThreadHierarchicalTestExecutorService.java:38) в org.j unit.platform.engine.support.hierarchical.NodeTestTask.lambda $ executeRecursively $ 5 (NodeTestTask.java:139) в org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute (ThrowableCollector.java.java:73) в .platform.engine.support.hierarchical.NodeTestTask.lambda $ executeRecursively $ 7 (NodeTestTask.java:125) в org.junit.platform.engine.support.hierarchical.Node.around (Node.java:135) в org.junit. platform.engine.support.hierarchical.NodeTestTask.lambda $ executeRecursively $ 8 (NodeTestTask.java:123) на org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute (ThrowableCollector.java:junit.org. .engine.support.hierarchical.NodeTestTask.executeRecursively (NodeTestTask.java:122) на org.junit.platform.engine.support.hierarchical.NodeTestTask.execute (NodeTestTask.java:80) на org.engine.platform .hierarchical.SameThreadHierarchicalTestExecutorService.submit (SameThreadHierarchicalTestExecutorService.java:32) на org.junit.platform.engine.su pport.hierarchical.HierarchicalTestExecutor.execute (HierarchicalTestExecutor.java:57) в org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute (HierarchicalTestEngine.java:51) в org.junit.platform.engine.support. выполнить (DefaultLauncher.java:248) в org.junit.platform.launcher.core.DefaultLauncher.lambda $ execute $ 5 (DefaultLauncher.java:211) в org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams (DefaultjavaLauncher : 226) на сайте org.junit.platform.launcher.core. DefaultLauncher.execute (DefaultLauncher.java:199) по адресу org.junit.platform.launcher.core.DefaultLauncher.execute (DefaultLauncher.java:132) по адресу com.intellij.junit5.JUnit5IdeaTestRunner.startRunner.java: .intellij.rt.junit.IdeaTestRunner $ Repeater.startRunnerWithArgs (IdeaTestRunner.java:33) в com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart (JUnitStarter.java:230.j. (JUnitStarter.java:58) Вызвано: org.apache.qpid.jms.util.ResourceNotFoundException: не удалось найти ресурс фабрики: META-INF / services / org / apache / qpid / jms / provider / t3 в org.apache. qpid.jms.util.FactoryFinder $ StandaloneObjectFactory.loadProperties (FactoryFinder.java:230) в org.apache.qpid.jms.util.FactoryFinder $ StandaloneObjectFactory.create (FactoryFinder.java:171) в org.apache.qpid. util.FactoryFinder.newInstance (FactoryFinder.java:129) в org.apache.qpid.jms.provider.ProviderFactory.findProviderFactory (ProviderFactory.java:154) ... 74 мин. руда - person Lorenzo Dimitri Bono; 10.09.2020

Но есть проблема, мне нужно подключиться к удаленной очереди WLS JMS по протоколу T3, который, похоже, не поддерживается = ›

t3: // локальный: 7001

2020-07-13 12: 31: 56,193 ОШИБКА [org.apa.qpi.jms.JmsConnectionFactory] (main) Не удалось создать экземпляр поставщика JMS для: t3

Спасибо, проверю :-)

person Lorenzo Dimitri Bono    schedule 13.07.2020