[ 
https://issues.apache.org/jira/browse/BEAM-8513?focusedWorklogId=337422&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-337422
 ]

ASF GitHub Bot logged work on BEAM-8513:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Nov/19 17:12
            Start Date: 01/Nov/19 17:12
    Worklog Time Spent: 10m 
      Work Description: jkff commented on pull request #9937: [BEAM-8513] Allow 
reads from exchange-bound queue without declaring the exchange
URL: https://github.com/apache/beam/pull/9937#discussion_r341665734
 
 

 ##########
 File path: 
sdks/java/io/rabbitmq/src/test/java/org/apache/beam/sdk/io/rabbitmq/ExchangeTestPlan.java
 ##########
 @@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.beam.sdk.io.rabbitmq;
+
+import com.rabbitmq.client.AMQP;
+import java.util.List;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+import javax.annotation.Nullable;
+
+/**
+ * RabbitMqIO documents "using a queue" vs "using an exchange", but AMQP 
always interacts with an
+ * exchange. The 'queue' semantics only make sense for a "direct exchange" 
where the routing key and
+ * queue name match.
+ *
+ * <p>To facilitate the many combinations of queue bindings, routing keys, and 
exchange declarations
+ * that could be used, this class has been implemented to help represent the 
parameters of a test
+ * oriented around reading messages published to an exchange.
+ */
+class ExchangeTestPlan {
 
 Review comment:
   Wonder if this class can be simpler if coded as an `@AutoValue`.
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 337422)
    Time Spent: 2h 50m  (was: 2h 40m)

> RabbitMqIO: Allow reads from exchange-bound queue without declaring the 
> exchange
> --------------------------------------------------------------------------------
>
>                 Key: BEAM-8513
>                 URL: https://issues.apache.org/jira/browse/BEAM-8513
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-rabbitmq
>         Environment: testing with DirectRunner
>            Reporter: Nick Aldwin
>            Assignee: Jean-Baptiste Onofré
>            Priority: Critical
>             Fix For: 2.18.0
>
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> The RabbitMqIO always declares an exchange if it is configured to read from 
> it.  This is problematic with pre-existing exchanges (a relatively common 
> pattern), as there's no provided configuration for the exchange beyond 
> exchange type.  (We stumbled on this because RabbitMqIO always declares a 
> non-durable exchange, which fails if the exchange already exists as a durable 
> exchange)
>  
> A solution to this would be to allow RabbitMqIO to read from an exchange 
> without declaring it.  This pattern is already available for queues via the 
> `queueDeclare` flag.  I propose an `exchangeDeclare` flag which preserves 
> existing behavior except for skipping the call to `exchangeDeclare` before 
> binding the queue to the exchange.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to