espertechinc / esper

Esper Complex Event Processing, Streaming SQL and Event Series Analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Send event type declared in EPL

icholy opened this issue · comments

I have an event type declared inside my EPL using create schema and want to submit an event of that type to the runtime. But I'm unable to get an EventSender for it.

create schema A (s string)

The following fails with: Event type named 'A' could not be found

runtime.getEventService().getEventSender("A")

I've been searching through the documentation without luck. Here's the full code:

import com.espertech.esper.common.client.configuration.Configuration;
import com.espertech.esper.compiler.client.CompilerArguments;
import com.espertech.esper.compiler.client.EPCompilerProvider;
import com.espertech.esper.runtime.client.EPRuntimeProvider;

import javax.swing.*;

public class Main {
    public static void main(String[] args) throws Exception {
        var configuration = new Configuration();
        var compiler = EPCompilerProvider.getCompiler();
        var arguments = new CompilerArguments(configuration);
        var module = compiler.parseModule("create schema A (s string)");
        var compiled = compiler.compile(module, arguments);
        var runtime = EPRuntimeProvider.getDefaultRuntime(configuration);
        var deployment = runtime.getDeploymentService().deploy(compiled);
        var sender = runtime.getEventService().getEventSender("A");
    }
}

Suggest to read up on @public @buseventtype i.e. visibility