You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exactly one of Topic or Subscription must be set in pubsubio.go (#35369)
* Exactly one of Topic or Subscription must be set in pubsubio.go
* Modifying current exaqmple Pubsub read calls as per new changes
* Updated changes.md and *ReadOptions
* Corrected test cases
* Update sdks/go/pkg/beam/io/pubsubio/pubsubio.go
Copy file name to clipboardExpand all lines: CHANGES.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,7 @@
83
83
## Breaking Changes
84
84
85
85
* X behavior was changed ([#X](https://github.com/apache/beam/issues/X)).
86
+
* Go: The pubsubio.Read transform now accepts ReadOptions as a value type instead of a pointer, and requires exactly one of Topic or Subscription to be set (they are mutually exclusive). Additionally, the ReadOptions struct now includes a Topic field for specifying the topic directly, replacing the previous topic parameter in the Read function signature ([#35369])(https://github.com/apache/beam/pull/35369).
Copy file name to clipboardExpand all lines: learning/tour-of-beam/learning-content/io/kafka-io/kafka-write/go-example/main.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ func main() {
76
76
77
77
// In the main function, the code creates a Beam pipeline, reads from the Pub/Sub source, transforms the data into a key-value pair, applies a windowing function to the data, and writes the windowed data to a Kafka topic.
78
78
79
-
data := pubsubio.Read(s, "pubsub-public-data", "taxirides-realtime", nil)
79
+
data := pubsubio.Read(s, "pubsub-public-data", pubsubio.ReadOptions{Topic: "taxirides-realtime"})
0 commit comments