Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AwsSqsJobHandlerSubscriptionService public... #3234

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
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
66 changes: 66 additions & 0 deletions misk-aws/api/misk-aws.api
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public final class misk/jobqueue/sqs/AwsSqsJobHandlerModule$Companion {
public static synthetic fun create$default (Lmisk/jobqueue/sqs/AwsSqsJobHandlerModule$Companion;Lmisk/jobqueue/QueueName;Lkotlin/reflect/KClass;ZLjava/util/List;ILjava/lang/Object;)Lmisk/jobqueue/sqs/AwsSqsJobHandlerModule;
}

public final class misk/jobqueue/sqs/AwsSqsJobHandlerSubscriptionService : com/google/common/util/concurrent/AbstractIdleService {
}

public final class misk/jobqueue/sqs/AwsSqsJobQueueConfig : wisp/config/Config {
public fun <init> ()V
public fun <init> (Ljava/util/Map;)V
Expand Down Expand Up @@ -104,6 +107,16 @@ public final class misk/jobqueue/sqs/AwsSqsJobReceiverPolicy : java/lang/Enum {
public static fun values ()[Lmisk/jobqueue/sqs/AwsSqsJobReceiverPolicy;
}

public final class misk/jobqueue/sqs/AwsSqsQueueAttributeImporter {
public static final field Companion Lmisk/jobqueue/sqs/AwsSqsQueueAttributeImporter$Companion;
public final fun getRunning ()Ljava/util/concurrent/atomic/AtomicBoolean;
public final fun import (Lmisk/jobqueue/QueueName;)V
public final fun shutDown ()V
}

public final class misk/jobqueue/sqs/AwsSqsQueueAttributeImporter$Companion {
}

public final class misk/jobqueue/sqs/AwsSqsQueueConfig {
public fun <init> ()V
public fun <init> (Ljava/lang/String;)V
Expand Down Expand Up @@ -187,12 +200,38 @@ public final class misk/jobqueue/sqs/FlaggedBufferedSqsClient$Companion {
public final fun getFEATURE ()Lmisk/feature/Feature;
}

public final class misk/jobqueue/sqs/QueueResolver {
public static final field Companion Lmisk/jobqueue/sqs/QueueResolver$Companion;
public final fun getDeadLetter (Lmisk/jobqueue/QueueName;)Lmisk/jobqueue/sqs/ResolvedQueue;
public final fun getForReceiving (Lmisk/jobqueue/QueueName;)Lmisk/jobqueue/sqs/ResolvedQueue;
public final fun getForSending (Lmisk/jobqueue/QueueName;)Lmisk/jobqueue/sqs/ResolvedQueue;
}

public final class misk/jobqueue/sqs/QueueResolver$Companion {
public final fun getLog ()Lmu/KLogger;
}

public final class misk/jobqueue/sqs/QueueResolverKt {
public static final fun getParentQueue (Lmisk/jobqueue/QueueName;)Lmisk/jobqueue/QueueName;
public static final fun getRetryQueue (Lmisk/jobqueue/QueueName;)Lmisk/jobqueue/QueueName;
public static final fun isRetryQueue (Lmisk/jobqueue/QueueName;)Z
}

public final class misk/jobqueue/sqs/ResolvedQueue {
public final fun call (Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public final fun getAccountId ()Lmisk/cloud/aws/AwsAccountId;
public final fun getClient ()Lcom/amazonaws/services/sqs/AmazonSQS;
public final fun getName ()Lmisk/jobqueue/QueueName;
public final fun getQueueName ()Ljava/lang/String;
public final fun getRegion ()Lmisk/cloud/aws/AwsRegion;
public final fun getSqsQueueName ()Lmisk/jobqueue/QueueName;
public final fun getUrl ()Ljava/lang/String;
}

public final class misk/jobqueue/sqs/ResolvedQueue$SQSException : java/lang/RuntimeException {
public fun <init> (Lcom/amazonaws/AmazonClientException;Lmisk/jobqueue/sqs/ResolvedQueue;)V
}

public final class misk/jobqueue/sqs/SqsConsumerAllocator {
public static final field Companion Lmisk/jobqueue/sqs/SqsConsumerAllocator$Companion;
public fun <init> (Lwisp/lease/LeaseManager;Lmisk/feature/FeatureFlags;)V
Expand All @@ -203,6 +242,33 @@ public final class misk/jobqueue/sqs/SqsConsumerAllocator$Companion {
public final fun leaseName (Lmisk/jobqueue/QueueName;I)Ljava/lang/String;
}

public final class misk/jobqueue/sqs/SqsJobConsumer : misk/jobqueue/JobConsumer {
public static final field Companion Lmisk/jobqueue/sqs/SqsJobConsumer$Companion;
public final fun shutDown ()V
public fun subscribe (Lmisk/jobqueue/QueueName;Lmisk/jobqueue/JobHandler;)V
public fun unsubscribe (Lmisk/jobqueue/QueueName;)V
}

public final class misk/jobqueue/sqs/SqsJobConsumer$Companion {
}

public final class misk/jobqueue/sqs/SqsMetrics {
public final fun getHandlerDispatchTime ()Lmisk/metrics/Histogram;
public final fun getHandlerFailures ()Lio/prometheus/client/Counter;
public final fun getJobEnqueueFailures ()Lio/prometheus/client/Counter;
public final fun getJobsAcknowledged ()Lio/prometheus/client/Counter;
public final fun getJobsDeadLettered ()Lio/prometheus/client/Counter;
public final fun getJobsEnqueued ()Lio/prometheus/client/Counter;
public final fun getJobsReceived ()Lio/prometheus/client/Counter;
public final fun getQueueProcessingLag ()Lmisk/metrics/Histogram;
public final fun getSqsApproxNumberOfMessages ()Lio/prometheus/client/Gauge;
public final fun getSqsApproxNumberOfMessagesNotVisible ()Lio/prometheus/client/Gauge;
public final fun getSqsDeleteTime ()Lmisk/metrics/Histogram;
public final fun getSqsReceiveTime ()Lmisk/metrics/Histogram;
public final fun getSqsSendTime ()Lmisk/metrics/Histogram;
public final fun getVisibilityTime ()Lio/prometheus/client/Gauge;
}

public final class misk/jobqueue/sqs/StaticDeadLetterQueueProvider : misk/jobqueue/sqs/DeadLetterQueueProvider {
public fun <init> (Ljava/lang/String;)V
public fun deadLetterQueueFor (Lmisk/jobqueue/QueueName;)Lmisk/jobqueue/QueueName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AwsSqsJobHandlerModule<T : JobHandler> private constructor(
}

@Singleton
internal class AwsSqsJobHandlerSubscriptionService @Inject constructor(
class AwsSqsJobHandlerSubscriptionService @Inject internal constructor(
private val attributeImporter: AwsSqsQueueAttributeImporter,
private val consumer: SqsJobConsumer,
private val consumerMapping: Map<QueueName, JobHandler>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.time.Duration
import java.util.concurrent.atomic.AtomicBoolean
import jakarta.inject.Inject

internal class AwsSqsQueueAttributeImporter @Inject constructor(
class AwsSqsQueueAttributeImporter @Inject internal constructor(
private val config: AwsSqsJobQueueConfig,
private val leaseManager: LeaseManager,
private val metrics: SqsMetrics,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import jakarta.inject.Inject
import jakarta.inject.Singleton

@Singleton
internal class QueueResolver @Inject internal constructor(
class QueueResolver @Inject internal constructor(
private val currentRegion: AwsRegion,
private val currentAccount: AwsAccountId,
private val defaultSQS: AmazonSQS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import misk.cloud.aws.AwsRegion
import misk.jobqueue.QueueName

/** [ResolvedQueue] provides information needed to reach an SQS queue */
internal class ResolvedQueue(
class ResolvedQueue internal constructor(
val name: QueueName,
val sqsQueueName: QueueName,
val url: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import com.google.inject.Provider
import jakarta.inject.Singleton

@Singleton
internal class SqsJobConsumer @Inject internal constructor(
class SqsJobConsumer @Inject internal constructor(
@ForSqsHandling private val handlingThreads: ExecutorService,
@ForSqsHandling private val taskQueue: RepeatedTaskQueue,
@ForSqsReceiving private val receivingThreads: ExecutorService,
Expand Down
2 changes: 1 addition & 1 deletion misk-aws/src/main/kotlin/misk/jobqueue/sqs/SqsMetrics.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import jakarta.inject.Singleton
* for queues both client-side and on SQS with the same label.
*/
@Singleton
internal class SqsMetrics @Inject internal constructor(metrics: Metrics) {
class SqsMetrics @Inject internal constructor(metrics: Metrics) {
val jobsEnqueued = metrics.counter(
"jobs_enqueued_total",
"total # of jobs sent to a queueName",
Expand Down
Loading