I have run into an issue where if I try to use a predicate or Consumer lambda expression such as the following examples, the Call Listener does not initialize and produces an error. I can run mvn install and the package compiles with no issue, but it fails to start up on the breeze clusters. We have 3.4.0. Simply commenting out that line of code allows the snap in to run with no problems.
The error produced is:
No initial listener found. See documentation regarding the annotations "TheCallListener"
Examples:
//routablePortErrorCodes is of type List<String>
if (routablePortErrorCodes.stream().noneMatch( str -> str.trim().equalsIgnoreCase( "any string" )) )
{ ... }
//events is a org.json.JSONArray, any use of .forEach on the array produces the error
events.forEach(o -> { log.info("test"); });
I'm able to run these successfully in a junit test so I know the code is sound.
@Test
public void arrayTest()
{
JSONArray array = new JSONArray();
for (int i = 0; i< 25; i++)
array.put("test");
array.forEach(o -> { System.out.println(o); });
}