org.wso2.carbon.databridge.commons.StreamDefinition Java Examples
The following examples show how to use
org.wso2.carbon.databridge.commons.StreamDefinition.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Wso2EventClient.java From product-cep with Apache License 2.0 | 6 votes |
public static void publish(String protocol, String host, String port, String username, String password, String streamId,String dataFileName, String testCaseFolderName, StreamDefinition streamDefinition, int events, int delay) throws MalformedStreamDefinitionException, StreamDefinitionException, DifferentStreamDefinitionAlreadyDefinedException, MalformedURLException, NoStreamDefinitionExistException, AuthenticationException, TransportException, SocketException, DataEndpointAgentConfigurationException, DataEndpointException, DataEndpointAuthenticationException, DataEndpointConfigurationException { String relativeFilePath = getTestDataFileLocation(testCaseFolderName, dataFileName); KeyStoreUtil.setTrustStoreParams(); //create data publisher DataPublisher dataPublisher = new DataPublisher(protocol, "tcp://" + host + ":" + port, null, username, password); //Publish event for a valid stream publishEvents(dataPublisher, streamDefinition, relativeFilePath, events, delay); dataPublisher.shutdown(); }
Example #2
Source File: DASApplicationSignUpDataPublisher.java From attic-stratos with Apache License 2.0 | 6 votes |
private static StreamDefinition getStreamDefinition() { try { // Create stream definition StreamDefinition streamDefinition = new StreamDefinition(DATASTREAM_NAME, VERSION); streamDefinition.setNickName(DATASTREAM_NICKNAME); streamDefinition.setDescription(DATASTREAM_DESC); List<Attribute> payloadData = new ArrayList<Attribute>(); // Set payload definition payloadData.add(new Attribute(APPLICATION_ID, AttributeType.STRING)); payloadData.add(new Attribute(TENANT_ID, AttributeType.INT)); payloadData.add(new Attribute(TENANT_DOMAIN, AttributeType.STRING)); payloadData.add(new Attribute(START_TIME, AttributeType.LONG)); payloadData.add(new Attribute(END_TIME, AttributeType.LONG)); payloadData.add(new Attribute(DURATION, AttributeType.LONG)); streamDefinition.setPayloadData(payloadData); return streamDefinition; } catch (Exception e) { throw new RuntimeException("Could not create stream definition", e); } }
Example #3
Source File: CartridgeSubscriptionDataPublisher.java From attic-stratos with Apache License 2.0 | 6 votes |
private static StreamDefinition initializeStream() throws Exception { streamDefinition = new StreamDefinition(CartridgeConstants.STRATOS_MANAGER_EVENT_STREAM, stratosManagerEventStreamVersion); streamDefinition.setNickName("stratos.manager"); streamDefinition.setDescription("Tenant Subscription Data"); // Payload definition List<Attribute> payloadData = new ArrayList<Attribute>(); payloadData.add(new Attribute(CartridgeConstants.TENANT_ID_COL, AttributeType.STRING)); payloadData.add(new Attribute(CartridgeConstants.ADMIN_USER_COL, AttributeType.STRING)); payloadData.add(new Attribute(CartridgeConstants.CARTRIDGE_ALIAS_COL, AttributeType.STRING)); payloadData.add(new Attribute(CartridgeConstants.CARTRIDGE_TYPE_COL, AttributeType.STRING)); payloadData.add(new Attribute(CartridgeConstants.REPOSITORY_URL_COL, AttributeType.STRING)); payloadData.add(new Attribute(CartridgeConstants.MULTI_TENANT_BEHAVIOR_COL, AttributeType.STRING)); payloadData.add(new Attribute(CartridgeConstants.AUTO_SCALE_POLICY_COL, AttributeType.STRING)); payloadData .add(new Attribute(CartridgeConstants.DEPLOYMENT_POLICY_COL, AttributeType.STRING)); payloadData.add(new Attribute(CartridgeConstants.CLUSTER_ID_COL, AttributeType.STRING)); payloadData.add(new Attribute(CartridgeConstants.HOST_NAME_COL, AttributeType.STRING)); payloadData.add(new Attribute(CartridgeConstants.MAPPED_DOMAIN_COL, AttributeType.STRING)); payloadData.add(new Attribute(CartridgeConstants.ACTION_COL, AttributeType.STRING)); streamDefinition.setPayloadData(payloadData); return streamDefinition; }
Example #4
Source File: WSO2CEPInFlightRequestPublisher.java From attic-stratos with Apache License 2.0 | 6 votes |
private static StreamDefinition createStreamDefinition() { try { // Create stream definition StreamDefinition streamDefinition = new StreamDefinition(DATA_STREAM_NAME, VERSION); streamDefinition.setNickName("lb stats"); streamDefinition.setDescription("lb stats"); List<Attribute> payloadData = new ArrayList<Attribute>(); // Set payload definition payloadData.add(new Attribute("cluster_id", AttributeType.STRING)); payloadData.add(new Attribute("cluster_instance_id", AttributeType.STRING)); payloadData.add(new Attribute("network_partition_id", AttributeType.STRING)); payloadData.add(new Attribute("in_flight_request_count", AttributeType.DOUBLE)); streamDefinition.setPayloadData(payloadData); return streamDefinition; } catch (Exception e) { throw new RuntimeException("Could not create stream definition", e); } }
Example #5
Source File: WSO2CEPHealthStatisticsPublisher.java From attic-stratos with Apache License 2.0 | 6 votes |
private static StreamDefinition createStreamDefinition() { try { // Create stream definition StreamDefinition streamDefinition = new StreamDefinition(DATA_STREAM_NAME, VERSION); streamDefinition.setNickName("agent health stats"); streamDefinition.setDescription("agent health stats"); // Set payload definition List<Attribute> payloadData = new ArrayList<Attribute>(); payloadData.add(new Attribute("cluster_id", AttributeType.STRING)); payloadData.add(new Attribute("cluster_instance_id", AttributeType.STRING)); payloadData.add(new Attribute("network_partition_id", AttributeType.STRING)); payloadData.add(new Attribute("member_id", AttributeType.STRING)); payloadData.add(new Attribute("partition_id", AttributeType.STRING)); payloadData.add(new Attribute("health_description", AttributeType.STRING)); payloadData.add(new Attribute("value", AttributeType.DOUBLE)); streamDefinition.setPayloadData(payloadData); return streamDefinition; } catch (Exception e) { throw new RuntimeException("Could not create stream definition", e); } }
Example #6
Source File: DASMemberStatusPublisher.java From attic-stratos with Apache License 2.0 | 6 votes |
private static StreamDefinition createStreamDefinition() { try { // Create stream definition StreamDefinition streamDefinition = new StreamDefinition(DATA_STREAM_NAME, VERSION); streamDefinition.setNickName("Member Lifecycle"); streamDefinition.setDescription("Member Lifecycle"); List<Attribute> payloadData = new ArrayList<Attribute>(); // Set payload definition payloadData.add(new Attribute(CloudControllerConstants.TIMESTAMP_COL, AttributeType.LONG)); payloadData.add(new Attribute(CloudControllerConstants.APPLICATION_ID_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.CLUSTER_ID_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.CLUSTER_ALIAS_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.CLUSTER_INSTANCE_ID_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.SERVICE_NAME_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.NETWORK_PARTITION_ID_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.PARTITION_ID_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.MEMBER_ID_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.MEMBER_STATUS_COL, AttributeType.STRING)); streamDefinition.setPayloadData(payloadData); return streamDefinition; } catch (Exception e) { throw new RuntimeException("Could not create stream definition", e); } }
Example #7
Source File: LogPublisher.java From attic-stratos with Apache License 2.0 | 5 votes |
public LogPublisher(DataPublisherConfiguration dataPublisherConfig, StreamDefinition streamDefinition, String filePath, String memberId, String tenantId, String alias, Long datetime) { super(dataPublisherConfig, streamDefinition); this.filePath = filePath; this.memberId = memberId; this.tenantId = tenantId; this.alias = alias; this.datetime = datetime; }
Example #8
Source File: ThriftStatisticsPublisher.java From attic-stratos with Apache License 2.0 | 5 votes |
/** * Credential information stored inside thrift-client-config.xml file * is parsed and assigned into ip,port,username and password fields * * @param streamDefinition Thrift Event Stream Definition * @param thriftClientName Thrift Client Name */ public ThriftStatisticsPublisher(StreamDefinition streamDefinition, String thriftClientName) { ThriftClientConfig thriftClientConfig = ThriftClientConfig.getInstance(); this.thriftClientInfoList = thriftClientConfig.getThriftClientInfo(thriftClientName); this.streamDefinition = streamDefinition; if (isPublisherEnabled()) { this.enabled = true; receiverGroups = new ArrayList<ReceiverGroup>(); dataPublisherHolders = new ArrayList<DataPublisherHolder>(); init(); } }
Example #9
Source File: DASMemberInformationPublisher.java From attic-stratos with Apache License 2.0 | 5 votes |
private static StreamDefinition createStreamDefinition() { try { // Create stream definition StreamDefinition streamDefinition = new StreamDefinition(DATA_STREAM_NAME, VERSION); streamDefinition.setNickName("Member Information"); streamDefinition.setDescription("Member Information"); List<Attribute> payloadData = new ArrayList<Attribute>(); // Set payload definition payloadData.add(new Attribute(CloudControllerConstants.MEMBER_ID_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.INSTANCE_TYPE_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.SCALING_DECISION_ID_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.IS_MULTI_TENANT_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.PRIV_IP_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.PUB_IP_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.ALLOCATED_IP_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.HOST_NAME_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.HYPERVISOR_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.CPU_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.RAM_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.IMAGE_ID_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.LOGIN_PORT_COL, AttributeType.INT)); payloadData.add(new Attribute(CloudControllerConstants.OS_NAME_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.OS_VERSION_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.OS_ARCH_COL, AttributeType.STRING)); payloadData.add(new Attribute(CloudControllerConstants.OS_BIT_COL, AttributeType.BOOL)); streamDefinition.setPayloadData(payloadData); return streamDefinition; } catch (Exception e) { throw new RuntimeException("Could not create stream definition", e); } }
Example #10
Source File: DASScalingDecisionPublisher.java From attic-stratos with Apache License 2.0 | 5 votes |
private static StreamDefinition createStreamDefinition() { try { // Create stream definition StreamDefinition streamDefinition = new StreamDefinition(DATA_STREAM_NAME, VERSION); streamDefinition.setNickName("Scaling Decision"); streamDefinition.setDescription("Scaling Decision"); List<Attribute> payloadData = new ArrayList<Attribute>(); // Set payload definition payloadData.add(new Attribute(AutoscalerConstants.TIMESTAMP, AttributeType.LONG)); payloadData.add(new Attribute(AutoscalerConstants.SCALING_DECISION_ID, AttributeType.STRING)); payloadData.add(new Attribute(AutoscalerConstants.CLUSTER_ID, AttributeType.STRING)); payloadData.add(new Attribute(AutoscalerConstants.MIN_INSTANCE_COUNT, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.MAX_INSTANCE_COUNT, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.RIF_PREDICTED, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.RIF_THRESHOLD, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.RIF_REQUIRED_INSTANCES, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.MC_PREDICTED, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.MC_THRESHOLD, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.MC_REQUIRED_INSTANCES, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.LA_PREDICTED, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.LA_THRESHOLD, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.LA_REQUIRED_INSTANCES, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.REQUIRED_INSTANCE_COUNT, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.ACTIVE_INSTANCE_COUNT, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.ADDITIONAL_INSTANCE_COUNT, AttributeType.INT)); payloadData.add(new Attribute(AutoscalerConstants.SCALING_REASON, AttributeType.STRING)); streamDefinition.setPayloadData(payloadData); return streamDefinition; } catch (Exception e) { throw new RuntimeException("Could not create stream definition", e); } }
Example #11
Source File: Client.java From product-cep with Apache License 2.0 | 4 votes |
public static void main(String[] args) { System.out.println(Arrays.deepToString(args)); try { System.out.println("Starting WSO2 Event Client"); AgentHolder.setConfigPath(DataPublisherUtil.getDataAgentConfigPath()); DataPublisherUtil.setTrustStoreParams(); String protocol = args[0]; String host = args[1]; String port = args[2]; String username = args[3]; String password = args[4]; String streamId = args[5]; String sampleNumber = args[6]; String filePath = args[7]; int events = Integer.parseInt(args[8]); int delay = Integer.parseInt(args[9]); Map<String, StreamDefinition> streamDefinitions = DataPublisherUtil.loadStreamDefinitions(sampleNumber); if (streamId == null || streamId.length() == 0) { throw new Exception("streamId not provided"); } StreamDefinition streamDefinition = streamDefinitions.get(streamId); if (streamDefinition == null) { throw new Exception("StreamDefinition not available for stream " + streamId); } else { log.info("StreamDefinition used :" + streamDefinition); } filePath = DataPublisherUtil.getEventFilePath(sampleNumber, streamId, filePath); //create data publisher DataPublisher dataPublisher = new DataPublisher(protocol, "tcp://" + host + ":" + port, null, username, password); //Publish event for a valid stream publishEvents(dataPublisher, streamDefinition, filePath, events, delay); dataPublisher.shutdownWithAgent(); } catch (Throwable e) { log.error(e); } }
Example #12
Source File: ThriftTestServer.java From product-private-paas with Apache License 2.0 | 4 votes |
public void addStreamDefinition(String streamDefinitionStr, int tenantId) throws StreamDefinitionStoreException, MalformedStreamDefinitionException { StreamDefinition streamDefinition = EventDefinitionConverterUtils.convertFromJson(streamDefinitionStr); getStreamDefinitionStore().saveStreamDefinitionToStore(streamDefinition, tenantId); }
Example #13
Source File: ThriftTestServer.java From product-private-paas with Apache License 2.0 | 4 votes |
public void addStreamDefinition(StreamDefinition streamDefinition, int tenantId) throws StreamDefinitionStoreException { streamDefinitionStore.saveStreamDefinitionToStore(streamDefinition, tenantId); }
Example #14
Source File: TestWso2EventServer.java From product-cep with Apache License 2.0 | 4 votes |
public void definedStream(StreamDefinition streamDefinition, int tenantID) { }
Example #15
Source File: TestWso2EventServer.java From product-cep with Apache License 2.0 | 4 votes |
@Override public void removeStream(StreamDefinition streamDefinition, int tenantID) { //To change body of implemented methods use File | Settings | File Templates. log.info("Test"); }
Example #16
Source File: ThriftStatisticsPublisherTest.java From attic-stratos with Apache License 2.0 | 4 votes |
@Before public void setUp() throws MalformedStreamDefinitionException { URL configFileUrl = ThriftClientConfigParserTest.class.getResource("/thrift-client-config.xml"); System.setProperty(ThriftClientConfig.THRIFT_CLIENT_CONFIG_FILE_PATH, configFileUrl.getPath()); streamDefinition = new StreamDefinition("Test", "1.0.0"); }
Example #17
Source File: InFlightRequestPublisher.java From attic-stratos with Apache License 2.0 | 4 votes |
public InFlightRequestPublisher(StreamDefinition streamDefinition, String thriftClientName) { super(streamDefinition, thriftClientName); }
Example #18
Source File: HealthStatisticsPublisher.java From attic-stratos with Apache License 2.0 | 4 votes |
public HealthStatisticsPublisher(StreamDefinition streamDefinition, String thriftClientName) { super(streamDefinition, thriftClientName); }
Example #19
Source File: TestWso2EventServer.java From product-cep with Apache License 2.0 | 4 votes |
public void definedStream(StreamDefinition streamDefinition, int tenantID) { }
Example #20
Source File: TestWso2EventServer.java From product-cep with Apache License 2.0 | 4 votes |
@Override public void removeStream(StreamDefinition streamDefinition, int tenantID) { //To change body of implemented methods use File | Settings | File Templates. log.info("Test"); }
Example #21
Source File: TestWso2EventServer.java From product-cep with Apache License 2.0 | 4 votes |
public void definedStream(StreamDefinition streamDefinition, int tenantID) { }
Example #22
Source File: TestWso2EventServer.java From product-cep with Apache License 2.0 | 4 votes |
@Override public void removeStream(StreamDefinition streamDefinition, int tenantID) { //To change body of implemented methods use File | Settings | File Templates. log.info("Test"); }
Example #23
Source File: ThriftTestServer.java From attic-stratos with Apache License 2.0 | 4 votes |
public void addStreamDefinition(String streamDefinitionStr, int tenantId) throws StreamDefinitionStoreException, MalformedStreamDefinitionException { StreamDefinition streamDefinition = EventDefinitionConverterUtils.convertFromJson(streamDefinitionStr); getStreamDefinitionStore().saveStreamDefinitionToStore(streamDefinition, tenantId); }
Example #24
Source File: MemberInformationPublisher.java From attic-stratos with Apache License 2.0 | 4 votes |
public MemberInformationPublisher(StreamDefinition streamDefinition, String thriftClientName) { super(streamDefinition, thriftClientName); }
Example #25
Source File: MemberStatusPublisher.java From attic-stratos with Apache License 2.0 | 4 votes |
public MemberStatusPublisher(StreamDefinition streamDefinition, String thriftClientName) { super(streamDefinition, thriftClientName); }
Example #26
Source File: DataPublisher.java From attic-stratos with Apache License 2.0 | 4 votes |
public DataPublisher(DataPublisherConfiguration dataPublisherConfig, StreamDefinition streamDefinition) { this.dataPublisherConfig = dataPublisherConfig; this.streamDefinition = streamDefinition; this.setDataPublisherInitialized(false); }
Example #27
Source File: LogPublisherManager.java From attic-stratos with Apache License 2.0 | 4 votes |
public void init(DataPublisherConfiguration dataPublisherConfig) throws DataPublisherException { this.dataPublisherConfig = dataPublisherConfig; List<Integer> ports = new ArrayList<Integer>(); ports.add(Integer.parseInt(dataPublisherConfig.getMonitoringServerPort())); ports.add(Integer.parseInt(dataPublisherConfig.getMonitoringServerSecurePort())); // wait till monitoring server ports are active CartridgeAgentUtils.waitUntilPortsActive(dataPublisherConfig.getMonitoringServerIp(), ports); if (!CartridgeAgentUtils.checkPortsActive(dataPublisherConfig.getMonitoringServerIp(), ports)) { throw new DataPublisherException("Monitoring server not active, data publishing is aborted"); } // stream definition identifier = {log.publisher.<cluster id>} try { streamDefinition = new StreamDefinition(Constants.LOG_PUBLISHER_STREAM_PREFIX + getValidTenantId(CartridgeAgentConfiguration.getInstance().getTenantId()) + "." + getAlias(CartridgeAgentConfiguration.getInstance().getClusterId()) + "." + getCurrentDate(), Constants.LOG_PUBLISHER_STREAM_VERSION); } catch (MalformedStreamDefinitionException e) { throw new RuntimeException(e); } streamDefinition.setDescription("Apache Stratos Instance Log Publisher"); List<Attribute> metaDataDefinition = new ArrayList<Attribute>(); metaDataDefinition.add(new Attribute(Constants.MEMBER_ID, AttributeType.STRING)); List<Attribute> payloadDataDefinition = new ArrayList<Attribute>(); payloadDataDefinition.add(new Attribute(Constants.TENANT_ID, AttributeType.STRING)); payloadDataDefinition.add(new Attribute(Constants.SERVER_NAME, AttributeType.STRING)); payloadDataDefinition.add(new Attribute(Constants.APP_NAME, AttributeType.STRING)); payloadDataDefinition.add(new Attribute(Constants.LOG_TIME, AttributeType.LONG)); payloadDataDefinition.add(new Attribute(Constants.PRIORITY, AttributeType.STRING)); payloadDataDefinition.add(new Attribute(Constants.MESSAGE, AttributeType.STRING)); payloadDataDefinition.add(new Attribute(Constants.LOGGER, AttributeType.STRING)); payloadDataDefinition.add(new Attribute(Constants.IP, AttributeType.STRING)); payloadDataDefinition.add(new Attribute(Constants.INSTANCE, AttributeType.STRING)); payloadDataDefinition.add(new Attribute(Constants.STACKTRACE, AttributeType.STRING)); streamDefinition.setMetaData(metaDataDefinition); streamDefinition.setPayloadData(payloadDataDefinition); }
Example #28
Source File: Wso2EventTestCase.java From product-cep with Apache License 2.0 | 4 votes |
@Test(groups = {"wso2.cep"}, description = "Testing wso2 event") public void wso2EventTestScenario() throws Exception { final int messageCount = 5; int startESCount = eventStreamManagerAdminServiceClient.getEventStreamCount(); int startERCount = eventReceiverAdminServiceClient.getActiveEventReceiverCount(); int startEPCount = eventPublisherAdminServiceClient.getActiveEventPublisherCount(); //Add StreamDefinition String streamDefinitionAsString = getJSONArtifactConfiguration("Wso2EventTestCase", "testWso2EventStream.json"); eventStreamManagerAdminServiceClient.addEventStreamAsString(streamDefinitionAsString); Assert.assertEquals(eventStreamManagerAdminServiceClient.getEventStreamCount(), startESCount + 1); StreamDefinition streamDefinition = EventDefinitionConverterUtils .convertFromJson(streamDefinitionAsString); //Add Wso2event EventReceiver String eventReceiverConfig = getXMLArtifactConfiguration("Wso2EventTestCase", "Wso2EventReceiver.xml"); eventReceiverAdminServiceClient.addEventReceiverConfiguration(eventReceiverConfig); Assert.assertEquals(eventReceiverAdminServiceClient.getActiveEventReceiverCount(), startERCount + 1); //Add Wso2event EventPublisher String eventPublisherConfig = getXMLArtifactConfiguration("Wso2EventTestCase", "Wso2EventPublisher.xml"); eventPublisherAdminServiceClient.addEventPublisherConfiguration(eventPublisherConfig); Assert.assertEquals(eventPublisherAdminServiceClient.getActiveEventPublisherCount(), startEPCount + 1); // The data-bridge receiver Wso2EventServer agentServer = new Wso2EventServer("Wso2EventTestCase", CEPIntegrationTestConstants.TCP_PORT, false); Thread agentServerThread = new Thread(agentServer); agentServerThread.start(); // Let the server start Thread.sleep(1000); Wso2EventClient.publish("thrift", "localhost", String.valueOf(CEPIntegrationTestConstants.TCP_PORT), "admin", "admin", streamDefinition.getStreamId(), "testWso2EventStreamData.csv", "Wso2EventTestCase", streamDefinition, 5, 1000); //wait while all stats are published Thread.sleep(30000); try { Assert.assertEquals(agentServer.getMsgCount(), messageCount, "Incorrect number of messages consumed!"); eventStreamManagerAdminServiceClient.removeEventStream("org.wso2.sample.pizza.order", "1.0.0"); eventPublisherAdminServiceClient.removeInactiveEventPublisherConfiguration("sendWso2EventsPublisher"); eventReceiverAdminServiceClient.removeInactiveEventReceiverConfiguration("wso2EventReceiver"); Thread.sleep(2000); } catch (Throwable e) { log.error("Exception thrown: " + e.getMessage(), e); Assert.fail("Exception: " + e.getMessage()); } finally { agentServer.stop(); } }
Example #29
Source File: FileBasedLogPublisher.java From attic-stratos with Apache License 2.0 | 4 votes |
public FileBasedLogPublisher(DataPublisherConfiguration dataPublisherConfig, StreamDefinition streamDefinition, String filePath, String memberId, String tenantId, String alias, Long datetime) { super(dataPublisherConfig, streamDefinition, filePath, memberId, tenantId, alias, datetime); this.executorService = Executors.newSingleThreadExecutor(new FileBasedLogPublisherTaskThreadFactory(filePath)); }
Example #30
Source File: ScalingDecisionPublisher.java From attic-stratos with Apache License 2.0 | 4 votes |
public ScalingDecisionPublisher(StreamDefinition streamDefinition, String thriftClientName) { super(streamDefinition, thriftClientName); }