This file contains hidden or 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
| PoolDataSource pds = PoolDataSourceFactory.getPoolDataSource(); | |
| pds.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource"); | |
| pds.setURL("jdbc:oracle:thin:@localhost:1521:XE"); | |
| pds.setUser("frank"); | |
| pds.setPassword("frank"); | |
| AqConnector seConn = AqConnector.builder() | |
| .dataSource("test-ds", pds) | |
| .build(); |
This file contains hidden or 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
| // Manually define JMS connection factory | |
| ActiveMQConnectionFactory connectionFactory = | |
| new ActiveMQConnectionFactory("tcp://192.168.0.123:61616"); | |
| // Setup connector | |
| JmsConnector seConn = JmsConnector.builder() | |
| .connectionFactory("jms-con-1", connectionFactory) | |
| .build(); | |
| // Prepare channels |
This file contains hidden or 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
| // Setup connector | |
| JmsConnector seConn = JmsConnector.create(); | |
| // Prepare channels | |
| Channel<String> toJms = Channel.<String>builder() | |
| .name("to-jms") | |
| .subscriberConfig(JmsConnector.configBuilder() | |
| .queue("example_queue_1") | |
| .jndiInitialFactory(ActiveMQInitialContextFactory.class) | |
| .jndiProviderUrl("tcp://192.168.0.123:61616") |
This file contains hidden or 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
| <dependency> | |
| <groupId>io.helidon.messaging.jms</groupId> | |
| <artifactId>helidon-messaging-jms</artifactId> | |
| </dependency> | |
| <!-- JMS client implenting JMS api of your choice--> | |
| <dependency> | |
| <groupId>org.apache.activemq</groupId> | |
| <artifactId>activemq-client</artifactId> | |
| </dependency> |
This file contains hidden or 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
| // Setup connector | |
| JmsConnector seConn = JmsConnector.create(); | |
| // Prepare channels | |
| Channel<String> toJms = Channel.create("to-jms"); | |
| Channel<String> fromJms = Channel.create("from-jms"); | |
| // Prepare emitter for interaction with non-reactive code | |
| Emitter<String> emitter = Emitter.create(toJms); |
This file contains hidden or 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
| javax: | |
| sql: | |
| DataSource: | |
| local-example-ds: | |
| connectionFactoryClassName: oracle.jdbc.pool.OracleDataSource | |
| URL: jdbc:oracle:thin:@localhost:1521:XE | |
| user: frank | |
| password: frank | |
| mp: |
This file contains hidden or 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
| <dependency> | |
| <groupId>io.helidon.microprofile.messaging</groupId> | |
| <artifactId>helidon-microprofile-messaging</artifactId> | |
| </dependency> | |
| <dependency> | |
| <groupId>io.helidon.messaging.aq</groupId> | |
| <artifactId>helidon-messaging-aq</artifactId> | |
| </dependency> | |
| <dependency> | |
| <groupId>io.helidon.integrations.cdi</groupId> |
This file contains hidden or 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
| @Outgoing("to-aq") | |
| public Publisher<String> toAq() { | |
| return FlowAdapters.toPublisher( | |
| Multi.interval(2, TimeUnit.SECONDS, Executors.newSingleThreadScheduledExecutor()) | |
| .map(i -> "Message " + i) | |
| ); | |
| } | |
| @Incoming("from-aq") |
This file contains hidden or 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
| private AtomicInteger counter = new AtomicInteger(); | |
| @Incoming("from-aq") | |
| @Acknowledgment(Acknowledgment.Strategy.MANUAL) | |
| public CompletionStage<?> fromAq(AqMessage<String> msg) { | |
| System.out.println("Received: " + msg.getPayload()); | |
| if (counter.getAndIncrement() == 5) { | |
| throw new RuntimeException("5th message exception!"); | |
| } | |
| //Acknowledgement/commit is called after the business code |
This file contains hidden or 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
| create user frank identified by SuperSecretPassword1234; | |
| grant connect to frank; | |
| grant resource to frank; | |
| grant execute on dbms_aq to frank; | |
| grant execute on dbms_aqadm to frank; | |
| grant execute on dbms_aqin to frank; | |
| grant unlimited tablespace to frank; | |
| BEGIN |