Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1808370
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:15:11+00:00 2026-05-17T06:15:11+00:00

I am a novice in using the Esper event stream engine in Java. The

  • 0

I am a novice in using the Esper event stream engine in Java. The scenario is that events are coming in as POJOs. They have a field that I want to filter on. The filtered values will change over time. I would prefer to not remove and insert a new statement every time a change occurs.

Example:

Event is named ‘MyEvent‘, and has the field ‘source‘. Value could be one of ‘home‘, ‘work‘, or ‘school‘.
A web service allows users to change the values for ‘source‘ they are interested in.
The EPL statement will look like

select * from MyEvent where source in ( 'home', 'school' )

So at any time, ‘school’ could be removed, and the impact must be reflected as fast as possible. The question is, how best to make this happen? I’ve ruled out cached database calls because of the latency between the update taking effect.

Ideas are:

1) Have a stream called ‘SourcesOfInterest’ with a ‘sources’ field of type List, and change the statement to be:

select * from MyEvent where source in (SourcesOfInterest.win:length(1).sources)

The web service inserts ‘SourcesOfInterest’ events into this stream, where only the most recent is looked at.
Not even sure if the syntax is right.

2) Have the statement reference a runtime variable. Then the statement would be:

select * from MyEvent where source in ( mySourcesVariable )

The web service would invoke

EPRuntime.setVariableValue( "mySourcesVariable", myArrayOfSources )

Are there other options? Performance issues to any of these?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T06:15:12+00:00Added an answer on May 17, 2026 at 6:15 am

    After some flailing, I used the second idea in the question.

    The variable needed to be set in the configuration, prior to startup, using

    Set<String> mySetOfValues = new HashSet<String>();

    esperConfiguration.addVariable( mySourcesVariable, Set.class, mySetOfValues );

    The web service works as described, with a Set instead of an array.

    All good now, and the performance is not obscenely bad, so I’m going with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a novice programmer (I only have been using Java and Matlab for
I am a novice to Java programming using Netbeans. I have added jCalendar to
Python novice here. I am using python2.7.2 on Windows7. I have installed the PyWin32
I'm using Drupal and I notice that if I have my CSS files aggregated
I am coming from a novice database programmer background, mainly using MS Access for
I'm a java novice and I've using the code below to display a list
I am a complete novice when coming to using Flash but I am looking
As a very novice Java programmer, I probably should not mess with that kind
I am a novice software developer and have only developed a few Java based
I'm a novice in Git and I have started learning Git by using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.