public EventHubSpoutConfig(String username, String password, String namespace, String entityPath, int partitionCount) { this.userName = username; this.password = password; this.connectionString = new ConnectionStringBuilder(namespace, entityPath, username, password).toString(); this.namespace = namespace; this.entityPath = entityPath; this.partitionCount = partitionCount; }
protected String getConnectionString(final String namespace, final String eventHubName, final String policyName, final String policyKey){ return new ConnectionStringBuilder(namespace, eventHubName, policyName, policyKey).toString(); } protected void sendMessage(final byte[] buffer) throws ProcessException {
public EventHubBoltConfig(String userName, String password, String namespace, String targetFqnAddress, String entityPath, boolean partitionMode, IEventDataFormat dataFormat) { this.connectionString = new ConnectionStringBuilder(namespace, entityPath, userName, password).toString(); this.entityPath = entityPath; this.partitionMode = partitionMode; this.dataFormat = dataFormat; if (this.dataFormat == null) { this.dataFormat = new DefaultEventDataFormat(); } }
@OnScheduled public void onScheduled(final ProcessContext context) throws ProcessException, URISyntaxException { final BlockingQueue<String> partitionNames = new LinkedBlockingQueue<>(); for (int i = 0; i < context.getProperty(NUM_PARTITIONS).asInteger(); i++) { partitionNames.add(String.valueOf(i)); } this.partitionNames = partitionNames; final String policyName = context.getProperty(ACCESS_POLICY).getValue(); final String policyKey = context.getProperty(POLICY_PRIMARY_KEY).getValue(); final String namespace = context.getProperty(NAMESPACE).getValue(); final String eventHubName = context.getProperty(EVENT_HUB_NAME).getValue(); final String serviceBusEndpoint = context.getProperty(SERVICE_BUS_ENDPOINT).getValue(); if(context.getProperty(ENQUEUE_TIME).isSet()) { configuredEnqueueTime = Instant.parse(context.getProperty(ENQUEUE_TIME).toString()); } else { configuredEnqueueTime = null; } if(context.getProperty(RECEIVER_FETCH_SIZE).isSet()) { receiverFetchSize = context.getProperty(RECEIVER_FETCH_SIZE).asInteger(); } else { receiverFetchSize = 100; } if(context.getProperty(RECEIVER_FETCH_TIMEOUT).isSet()) { receiverFetchTimeout = Duration.ofMillis(context.getProperty(RECEIVER_FETCH_TIMEOUT).asLong()); } else { receiverFetchTimeout = null; } final String connectionString = new ConnectionStringBuilder(new URI("amqps://"+namespace+serviceBusEndpoint), eventHubName, policyName, policyKey).toString(); setupReceiver(connectionString); }
final ConnectionStringBuilder eventHubConnectionString = new ConnectionStringBuilder(namespaceName, eventHubName, sasName, sasKey);