Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.lightbend.paradox.apidoc.ApidocPlugin.autoImport.apidocRootPackage
sourceDistName := "apache-pekko-http"
sourceDistIncubating := false

ThisBuild / resolvers += Resolver.ApacheMavenSnapshotsRepo
ThisBuild / reproducibleBuildsCheckResolver := Resolver.ApacheMavenStagingRepo

addCommandAlias("verifyCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck; +headerCheckAll; javafmtCheckAll")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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.

# changes needed to uptake Pekko Core 2.0.0
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.impl.engine.client.PoolInterface#Logic.onDownstreamFinish")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.impl.engine.http2.Http2StreamHandling#IncomingStreamBuffer.onDownstreamFinish")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.impl.engine.http2.hpack.HandleOrPassOnStage#State.onDownstreamFinish")
Original file line number Diff line number Diff line change
Expand Up @@ -721,12 +721,11 @@ private[http] object HttpServerBluePrint {
})

private var activeTimers = 0
private val timeout: FiniteDuration = {
private val timeout: FiniteDuration =
inheritedAttributes.get[ActorAttributes.StreamSubscriptionTimeout] match {
case Some(attr) => attr.timeout
case None => 5.minutes // should not happen
}
}
private def addTimeout(s: SubscriptionTimeout): Unit = {
if (activeTimers == 0) setKeepGoing(true)
activeTimers += 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ package org.apache.pekko.http.impl.util
import org.apache.pekko
import pekko.annotation.InternalApi
import pekko.stream.stage.GraphStageLogic
import pekko.event.{ LogSource, LoggingAdapter, NoLogging }
import pekko.stream.ActorMaterializer
import pekko.event.{ LogSource, LoggingAdapter }

// TODO Try to reconcile with what Pekko provides in StageLogging.
// We thought this could be removed when https://github.com/akka/akka/issues/18793 had been implemented
Expand All @@ -43,10 +42,7 @@ private[pekko] trait StageLoggingWithOverride extends GraphStageLogic {
_log =
logOverride match {
case DefaultNoLogging =>
materializer match {
case a: ActorMaterializer => pekko.event.Logging(a.system, logSource)(LogSource.fromClass)
case _ => NoLogging
}
pekko.event.Logging(materializer.system, logSource)(LogSource.fromClass)
case x => x
}
case _ =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

package org.apache.pekko.http.javadsl.server;

import org.apache.pekko.japi.pf.FI;
import org.apache.pekko.japi.function.Function;
import org.apache.pekko.japi.function.Predicate;
import org.apache.pekko.japi.pf.PFBuilder;

public class ExceptionHandlerBuilder {
Expand All @@ -35,7 +36,7 @@ private ExceptionHandlerBuilder(PFBuilder<Throwable, Route> delegate) {
* @return a builder with the case statement added
*/
public <P extends Throwable> ExceptionHandlerBuilder match(
final Class<P> type, FI.Apply<P, Route> apply) {
final Class<P> type, final Function<P, Route> apply) {
delegate.match(type, apply);
return this;
}
Expand All @@ -50,7 +51,7 @@ public <P extends Throwable> ExceptionHandlerBuilder match(
* @return a builder with the case statement added
*/
public <P extends Throwable> ExceptionHandlerBuilder match(
final Class<P> type, final FI.TypedPredicate<P> predicate, final FI.Apply<P, Route> apply) {
final Class<P> type, final Predicate<P> predicate, final Function<P, Route> apply) {
delegate.match(type, predicate, apply);
return this;
}
Expand All @@ -63,7 +64,7 @@ public <P extends Throwable> ExceptionHandlerBuilder match(
* @return a builder with the case statement added
*/
public <P extends Throwable> ExceptionHandlerBuilder matchEquals(
final P object, final FI.Apply<P, Route> apply) {
final P object, final Function<P, Route> apply) {
delegate.matchEquals(object, apply);
return this;
}
Expand All @@ -74,7 +75,7 @@ public <P extends Throwable> ExceptionHandlerBuilder matchEquals(
* @param apply an action to apply to the argument
* @return a builder with the case statement added
*/
public ExceptionHandlerBuilder matchAny(final FI.Apply<Throwable, Route> apply) {
public ExceptionHandlerBuilder matchAny(final Function<Throwable, Route> apply) {
delegate.matchAny(apply);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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.

# refactor Java DSL ExceptionHandler (due to function changes in Pekko Core 2.0.0)
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.javadsl.server.ExceptionHandlerBuilder.match")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.javadsl.server.ExceptionHandlerBuilder.matchEquals")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.javadsl.server.ExceptionHandlerBuilder.matchAny")
3 changes: 3 additions & 0 deletions http/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# This is the reference config file that contains all the default settings.
# Make your edits/overrides in your application.conf.

# Disable version checks (should not be merged to main branch)
pekko.fail-mixed-versions=off

pekko.http {
routing {
# Enables/disables the returning of more detailed error messages to the
Expand Down
2 changes: 1 addition & 1 deletion project/PekkoCoreDependency.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ import com.github.pjfanning.pekkobuild.PekkoDependency
object PekkoCoreDependency extends PekkoDependency {
override val checkProject: String = "pekko-cluster-sharding-typed"
override val module: Option[String] = None
override val currentVersion: String = "1.1.5"
override val currentVersion: String = "2.0.0-M0+180-84daa526-SNAPSHOT"
}
Loading