lukecwik commented on code in PR #22932:
URL: https://github.com/apache/beam/pull/22932#discussion_r997276356


##########
sdks/java/io/jms/src/test/java/org/apache/beam/sdk/io/jms/JmsIOTest.java:
##########
@@ -555,6 +556,101 @@ public void testCustomAutoscaler() throws IOException {
     verify(autoScaler, times(1)).stop();
   }
 
+  @Test
+  public void testCloseWithTimeout()
+      throws IOException, NoSuchFieldException, IllegalAccessException {
+
+    int closeTimeout = 2000;
+    JmsIO.Read spec =
+        JmsIO.read()
+            .withConnectionFactory(connectionFactory)
+            .withUsername(USERNAME)
+            .withPassword(PASSWORD)
+            .withQueue(QUEUE)
+            .withCloseTimeout(closeTimeout);
+
+    JmsIO.UnboundedJmsSource source = new JmsIO.UnboundedJmsSource(spec);
+    JmsIO.UnboundedJmsReader reader = source.createReader(null, null);
+
+    reader.start();
+    reader.close();

Review Comment:
   `pipelineOptions.as(ExecutorOptions.class).getScheduledExecutorService()`, 
the key part being the 
[as(...)](https://beam.apache.org/releases/javadoc/2.41.0/org/apache/beam/sdk/options/PipelineOptionsFactory.html#as-java.lang.Class-)
 method



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to