forked from helidon-io/helidon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3.x] 6262 JMS JNDI destination support (helidon-io#6301)
* 6262 JMS JNDI destination support
- Loading branch information
Showing
16 changed files
with
264 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
messaging/connectors/wls-jms/src/main/resources/META-INF/helidon/serial-config.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# Copyright (c) 2023 Oracle and/or its affiliates. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
pattern=weblogic.**;java.util.**;java.lang.**;java.io.**;java.rmi.** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
...gration/jms/src/test/java/io/helidon/messaging/connectors/jms/JmsInjectedFactoryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* Copyright (c) 2023 Oracle and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.helidon.messaging.connectors.jms; | ||
|
||
import java.time.Duration; | ||
import java.util.stream.IntStream; | ||
|
||
import io.helidon.common.reactive.Multi; | ||
import io.helidon.messaging.connectors.jms.shim.JakartaJms; | ||
import io.helidon.messaging.connectors.mock.MockConnector; | ||
import io.helidon.messaging.connectors.mock.TestConnector; | ||
import io.helidon.microprofile.config.ConfigCdiExtension; | ||
import io.helidon.microprofile.messaging.MessagingCdiExtension; | ||
import io.helidon.microprofile.tests.junit5.AddBean; | ||
import io.helidon.microprofile.tests.junit5.AddConfig; | ||
import io.helidon.microprofile.tests.junit5.AddExtension; | ||
import io.helidon.microprofile.tests.junit5.DisableDiscovery; | ||
import io.helidon.microprofile.tests.junit5.HelidonTest; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.enterprise.inject.Produces; | ||
import jakarta.inject.Inject; | ||
import jakarta.inject.Named; | ||
import org.apache.activemq.ActiveMQConnectionFactory; | ||
import org.eclipse.microprofile.reactive.messaging.Incoming; | ||
import org.eclipse.microprofile.reactive.messaging.Outgoing; | ||
import org.eclipse.microprofile.reactive.streams.operators.ProcessorBuilder; | ||
import org.eclipse.microprofile.reactive.streams.operators.ReactiveStreams; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static io.helidon.messaging.connectors.jms.JmsConnector.CONNECTOR_NAME; | ||
import static org.eclipse.microprofile.reactive.messaging.spi.ConnectorFactory.CONNECTOR_PREFIX; | ||
import static org.eclipse.microprofile.reactive.messaging.spi.ConnectorFactory.INCOMING_PREFIX; | ||
import static org.eclipse.microprofile.reactive.messaging.spi.ConnectorFactory.OUTGOING_PREFIX; | ||
|
||
@HelidonTest | ||
@DisableDiscovery | ||
@AddBean(JmsConnector.class) | ||
@AddBean(MockConnector.class) | ||
@AddExtension(ConfigCdiExtension.class) | ||
@AddExtension(MessagingCdiExtension.class) | ||
@AddConfig(key = CONNECTOR_PREFIX + CONNECTOR_NAME + ".period-executions", value = "5") | ||
@AddConfig(key = CONNECTOR_PREFIX + CONNECTOR_NAME + ".destination", value = "TestQueue1") | ||
|
||
@AddConfig(key = OUTGOING_PREFIX + "to-jms.connector", value = CONNECTOR_NAME) | ||
@AddConfig(key = OUTGOING_PREFIX + "to-jms.named-factory", value = "activemq-cf-jakarta") | ||
@AddConfig(key = INCOMING_PREFIX + "from-jms.connector", value = CONNECTOR_NAME) | ||
@AddConfig(key = INCOMING_PREFIX + "from-jms.named-factory", value = "activemq-cf-jakarta") | ||
@AddConfig(key = OUTGOING_PREFIX + "to-mock.connector", value = MockConnector.CONNECTOR_NAME) | ||
public class JmsInjectedFactoryTest { | ||
|
||
static final Duration TIME_OUT = Duration.ofSeconds(15); | ||
static final Integer[] TEST_DATA = IntStream.range(0, 10).boxed().toArray(Integer[]::new); | ||
|
||
@Inject | ||
@TestConnector | ||
private MockConnector mockConnector; | ||
|
||
@Produces | ||
@ApplicationScoped | ||
@Named("activemq-cf-jakarta") | ||
public jakarta.jms.ConnectionFactory connectionFactory() { | ||
return JakartaJms.create(new ActiveMQConnectionFactory(AbstractJmsTest.BROKER_URL)); | ||
} | ||
|
||
@Outgoing("to-jms") | ||
public Multi<String> produceData() { | ||
return Multi.just(TEST_DATA) | ||
.map(String::valueOf); | ||
} | ||
|
||
@Incoming("from-jms") | ||
@Outgoing("to-mock") | ||
public ProcessorBuilder<String, Integer> resendToMock() { | ||
return ReactiveStreams.<String>builder() | ||
.map(Integer::parseInt); | ||
} | ||
|
||
@Test | ||
void jmsInOutTest() { | ||
mockConnector.outgoing("to-mock", Integer.TYPE) | ||
.awaitPayloads(TIME_OUT, TEST_DATA); | ||
} | ||
} |
Oops, something went wrong.