public static Optional < String > extractStreamId ( String filter ) { if ( isNullOrEmpty ( filter ) ) { return Optional . empty ( ) ; } final Matcher streamIdMatcher = filterStreamIdPattern . matcher ( filter ) ; if ( streamIdMatcher . find ( ) ) { return Optional . of ( streamIdMatcher . group ( 2 ) ) ; } return Optional . empty ( ) ; }
Extracts the last stream id from the filter string passed as part of the elasticsearch query . This is used later to pass to possibly existing message decorators for stream - specific configurations .