This is an automated email from the ASF dual-hosted git repository.
pjfanning pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-connectors.git
The following commit(s) were added to refs/heads/main by this push:
new f0bf411d0 remove deprecated fields from config (#1731)
f0bf411d0 is described below
commit f0bf411d0cb57ca67e3ef4ec445c8afda4454532
Author: PJ Fanning <[email protected]>
AuthorDate: Sat Jun 27 13:47:33 2026 +0100
remove deprecated fields from config (#1731)
* remove deprecated fields from config
* compile
* Update remove-deprecated-methods.backwards.excludes
* Update remove-deprecated-methods.backwards.excludes
---
.../pubsub/grpc/AutoExtendAckDeadlinesSpec.scala | 3 +--
.../remove-deprecated-methods.backwards.excludes | 2 ++
.../stream/connectors/googlecloud/pubsub/model.scala | 15 +++------------
.../googlecloud/pubsub/scaladsl/GooglePubSub.scala | 11 +++--------
4 files changed, 9 insertions(+), 22 deletions(-)
diff --git
a/google-cloud-pub-sub-grpc/src/test/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/grpc/AutoExtendAckDeadlinesSpec.scala
b/google-cloud-pub-sub-grpc/src/test/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/grpc/AutoExtendAckDeadlinesSpec.scala
index a4e0eb565..6d35b9f73 100644
---
a/google-cloud-pub-sub-grpc/src/test/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/grpc/AutoExtendAckDeadlinesSpec.scala
+++
b/google-cloud-pub-sub-grpc/src/test/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/grpc/AutoExtendAckDeadlinesSpec.scala
@@ -20,16 +20,15 @@ package
org.apache.pekko.stream.connectors.googlecloud.pubsub.grpc
import org.apache.pekko
import pekko.{ Done, NotUsed }
import pekko.actor.ActorSystem
+import pekko.stream._
import pekko.stream.scaladsl.{ Keep, Sink, Source }
import pekko.stream.connectors.googlecloud.pubsub.grpc.scaladsl.{
GooglePubSub, GrpcSubscriber, PubSubAttributes }
import com.google.protobuf.ByteString
import com.google.pubsub.v1.pubsub._
-import org.apache.pekko.stream._
import java.util.concurrent.ConcurrentLinkedQueue
import scala.concurrent.{ Future, Promise }
import scala.concurrent.duration._
-import scala.jdk.CollectionConverters._
import org.scalatest.BeforeAndAfterAll
import org.scalatest.concurrent.{ Eventually, ScalaFutures }
import org.scalatest.matchers.should.Matchers
diff --git
a/google-cloud-pub-sub/src/main/mima-filters/2.0.x.backward.excludes/remove-deprecated-methods.backwards.excludes
b/google-cloud-pub-sub/src/main/mima-filters/2.0.x.backward.excludes/remove-deprecated-methods.backwards.excludes
index 138f1bd8f..eb1b86596 100644
---
a/google-cloud-pub-sub/src/main/mima-filters/2.0.x.backward.excludes/remove-deprecated-methods.backwards.excludes
+++
b/google-cloud-pub-sub/src/main/mima-filters/2.0.x.backward.excludes/remove-deprecated-methods.backwards.excludes
@@ -18,3 +18,5 @@
# remove deprecated methods
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.connectors.googlecloud.pubsub.PubSubConfig.create")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.connectors.googlecloud.pubsub.PubSubConfig.apply")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.connectors.googlecloud.pubsub.PubSubConfig.projectId")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.connectors.googlecloud.pubsub.PubSubConfig.settings")
diff --git
a/google-cloud-pub-sub/src/main/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/model.scala
b/google-cloud-pub-sub/src/main/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/model.scala
index e88d97585..957d2dfaf 100644
---
a/google-cloud-pub-sub/src/main/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/model.scala
+++
b/google-cloud-pub-sub/src/main/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/model.scala
@@ -16,29 +16,20 @@ package
org.apache.pekko.stream.connectors.googlecloud.pubsub
import java.time.Instant
import org.apache.pekko
import pekko.annotation.InternalApi
-import pekko.stream.connectors.google.GoogleSettings
-import scala.annotation.nowarn
import scala.collection.immutable
import scala.jdk.CollectionConverters._
/**
- * @param projectId (deprecated) the project Id in the google account
* @param pullReturnImmediately when pulling messages, if there are non the
API will wait or return immediately. Defaults to true.
* @param pullMaxMessagesPerInternalBatch when pulling messages, the maximum
that will be in the batch of messages. Defaults to 1000.
*/
class PubSubConfig private (
- /** @deprecated Use [[pekko.stream.connectors.google.GoogleSettings]] */
- @deprecated(
- "Use org.apache.pekko.stream.connectors.google.GoogleSettings",
- "Alpakka 3.0.0") @Deprecated(since = "Alpakka 3.0.0") val projectId:
String,
val pullReturnImmediately: Boolean,
- val pullMaxMessagesPerInternalBatch: Int,
- @deprecated("Added only to help with migration", "Alpakka 3.0.0")
@InternalApi private[pubsub] val settings: Option[
- GoogleSettings]) {
+ val pullMaxMessagesPerInternalBatch: Int) {
override def toString: String =
- s"PubSubConfig(projectId=$projectId)": @nowarn("msg=deprecated")
+
s"PubSubConfig(pullReturnImmediately=$pullReturnImmediately,pullMaxMessagesPerInternalBatch=$pullMaxMessagesPerInternalBatch)"
}
object PubSubConfig {
@@ -46,7 +37,7 @@ object PubSubConfig {
def apply(): PubSubConfig = apply(true, 1000)
def apply(pullReturnImmediately: Boolean, pullMaxMessagesPerInternalBatch:
Int): PubSubConfig =
- new PubSubConfig("", pullReturnImmediately,
pullMaxMessagesPerInternalBatch, None)
+ new PubSubConfig(pullReturnImmediately, pullMaxMessagesPerInternalBatch)
def create(): PubSubConfig = apply()
diff --git
a/google-cloud-pub-sub/src/main/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/scaladsl/GooglePubSub.scala
b/google-cloud-pub-sub/src/main/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/scaladsl/GooglePubSub.scala
index 9cee93b6e..5ae4b99be 100644
---
a/google-cloud-pub-sub/src/main/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/scaladsl/GooglePubSub.scala
+++
b/google-cloud-pub-sub/src/main/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/scaladsl/GooglePubSub.scala
@@ -22,7 +22,6 @@ import pekko.stream.connectors.googlecloud.pubsub.impl._
import pekko.stream.scaladsl.{ Flow, FlowWithContext, Keep, Sink, Source }
import pekko.{ Done, NotUsed }
-import scala.annotation.nowarn
import scala.collection.immutable
import scala.concurrent.Future
import scala.concurrent.duration._
@@ -123,7 +122,7 @@ protected[pubsub] trait GooglePubSub {
// some wrapping back and forth as FlowWithContext doesn't offer `setup`
// https://github.com/akka/akka/issues/27883
FlowWithContext
- .fromTuples(flow(config)(httpApi.publish[C](topic, parallelism,
overrideHost).asFlow))
+ .fromTuples(httpApi.publish[C](topic, parallelism, overrideHost).asFlow)
.map(_.messageIds)
/**
@@ -139,7 +138,7 @@ protected[pubsub] trait GooglePubSub {
* Creates a flow pulling messages from a subscription.
*/
def subscribeFlow(subscription: String, config: PubSubConfig): Flow[Done,
ReceivedMessage, Future[NotUsed]] = {
- flow(config)(httpApi.pull(subscription, config.pullReturnImmediately,
config.pullMaxMessagesPerInternalBatch))
+ httpApi.pull(subscription, config.pullReturnImmediately,
config.pullMaxMessagesPerInternalBatch)
.mapConcat(_.receivedMessages.getOrElse(Seq.empty[ReceivedMessage]).toIndexedSeq)
}.mapMaterializedValue(_ => Future.successful(NotUsed))
@@ -147,7 +146,7 @@ protected[pubsub] trait GooglePubSub {
* Creates a flow for acknowledging messages on a subscription.
*/
def acknowledgeFlow(subscription: String, config: PubSubConfig):
Flow[AcknowledgeRequest, Done, NotUsed] =
- flow(config)(httpApi.acknowledge(subscription))
+ httpApi.acknowledge(subscription)
/**
* Creates a sink for acknowledging messages on a subscription.
@@ -155,8 +154,4 @@ protected[pubsub] trait GooglePubSub {
def acknowledge(subscription: String, config: PubSubConfig):
Sink[AcknowledgeRequest, Future[Done]] =
acknowledgeFlow(subscription, config).toMat(Sink.ignore)(Keep.right)
- @nowarn("msg=deprecated")
- private def flow[In, Out](config: PubSubConfig)(flow: Flow[In, Out,
NotUsed]): Flow[In, Out, NotUsed] =
-
flow.addAttributes(config.settings.fold(Attributes.none)(GoogleAttributes.settings))
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]