public PersistentMessageExpiryMonitor(String topicName, String subscriptionName, ManagedCursor cursor) { this.topicName = topicName; this.cursor = cursor; this.subName = subscriptionName; this.msgExpired = new Rate(); }
public PersistentMessageExpiryMonitor(String topicName, String subscriptionName, ManagedCursor cursor) { this.topicName = topicName; this.cursor = cursor; this.subName = subscriptionName; this.msgExpired = new Rate(); }
public Producer(Topic topic, ServerCnx cnx, long producerId, String producerName, String appId) { this.topic = topic; this.cnx = cnx; this.producerId = producerId; this.producerName = checkNotNull(producerName); this.closeFuture = new CompletableFuture<>(); this.appId = appId; this.msgIn = new Rate(); this.stats = new PublisherStats(); stats.address = cnx.clientAddress().toString(); stats.connectedSince = DATE_FORMAT.format(Instant.now()); stats.clientVersion = cnx.getClientVersion(); stats.producerName = producerName; stats.producerId = producerId; this.isRemote = producerName .startsWith(cnx.getBrokerService().pulsar().getConfiguration().getReplicatorPrefix()); this.remoteCluster = isRemote ? producerName.split("\\.")[2] : null; }
public Consumer(Subscription subscription, SubType subType, long consumerId, int priorityLevel, String consumerName, int maxUnackedMessages, ServerCnx cnx, String appId) throws BrokerServiceException { this.subscription = subscription; this.subType = subType; this.consumerId = consumerId; this.priorityLevel = priorityLevel; this.consumerName = consumerName; this.maxUnackedMessages = maxUnackedMessages; this.cnx = cnx; this.msgOut = new Rate(); this.msgRedeliver = new Rate(); this.appId = appId; PERMITS_RECEIVED_WHILE_CONSUMER_BLOCKED_UPDATER.set(this, 0); MESSAGE_PERMITS_UPDATER.set(this, 0); UNACKED_MESSAGES_UPDATER.set(this, 0); stats = new ConsumerStats(); stats.address = cnx.clientAddress().toString(); stats.consumerName = consumerName; stats.connectedSince = DATE_FORMAT.format(Instant.now()); stats.clientVersion = cnx.getClientVersion(); if (subType == SubType.Shared) { this.pendingAcks = new ConcurrentLongLongPairHashMap(256, 1); } else { // We don't need to keep track of pending acks if the subscription is not shared this.pendingAcks = null; } }
public NonPersistentDispatcherSingleActiveConsumer(SubType subscriptionType, int partitionIndex, NonPersistentTopic topic, Subscription subscription) { super(subscriptionType, partitionIndex, topic.getName()); this.topic = topic; this.subscription = subscription; this.msgDrop = new Rate(); this.serviceConfig = topic.getBrokerService().pulsar().getConfiguration(); this.redeliveryTracker = RedeliveryTrackerDisabled.REDELIVERY_TRACKER_DISABLED; }
public NonPersistentDispatcherMultipleConsumers(NonPersistentTopic topic, Subscription subscription) { this.topic = topic; this.subscription = subscription; this.name = topic.getName() + " / " + subscription.getName(); this.msgDrop = new Rate(); this.serviceConfig = topic.getBrokerService().pulsar().getConfiguration(); this.redeliveryTracker = RedeliveryTrackerDisabled.REDELIVERY_TRACKER_DISABLED; }
public Producer(Topic topic, ServerCnx cnx, long producerId, String producerName, String appId, boolean isEncrypted, Map<String, String> metadata, SchemaVersion schemaVersion) { this.topic = topic; this.cnx = cnx; this.producerId = producerId; this.producerName = checkNotNull(producerName); this.closeFuture = new CompletableFuture<>(); this.appId = appId; this.authenticationData = cnx.authenticationData; this.msgIn = new Rate(); this.isNonPersistentTopic = topic instanceof NonPersistentTopic; this.msgDrop = this.isNonPersistentTopic ? new Rate() : null; this.metadata = metadata != null ? metadata : Collections.emptyMap(); this.stats = isNonPersistentTopic ? new NonPersistentPublisherStats() : new PublisherStats(); stats.setAddress(cnx.clientAddress().toString()); stats.setConnectedSince(DateFormatter.now()); stats.setClientVersion(cnx.getClientVersion()); stats.setProducerName(producerName); stats.producerId = producerId; stats.metadata = this.metadata; this.isRemote = producerName .startsWith(cnx.getBrokerService().pulsar().getConfiguration().getReplicatorPrefix()); this.remoteCluster = isRemote ? producerName.split("\\.")[2] : null; this.isEncrypted = isEncrypted; this.schemaVersion = schemaVersion; }