Description
StreamHandler currently can't uses jars that via the runtimeLib and Blob Store api. This is because the StreamHandler uses core.getResourceLoader() instead of core.getMemClassLoader() for loading classes.
An example of this working with the fix is here: https://github.com/risdenk/solr_custom_streaming_expressions
Steps:
# Inspired by https://cwiki.apache.org/confluence/display/solr/Adding+Custom+Plugins+in+SolrCloud+Mode # Start Solr with enabling Blob Store ./bin/solr start -c -f -a "-Denable.runtime.lib=true" # Create test collection ./bin/solr create -c test # Create .system collection curl 'http://localhost:8983/solr/admin/collections?action=CREATE&name=.system' # Build custom streaming expression jar (cd custom-streaming-expression && mvn clean package) # Upload jar to .system collection using Blob Store API (https://cwiki.apache.org/confluence/display/solr/Blob+Store+API) curl -X POST -H 'Content-Type: application/octet-stream' --data-binary @custom-streaming-expression/target/custom-streaming-expression-1.0-SNAPSHOT.jar 'http://localhost:8983/solr/.system/blob/test' # List all blobs that are stored curl 'http://localhost:8983/solr/.system/blob?omitHeader=true' # Add the jar to the runtime lib curl 'http://localhost:8983/solr/test/config' -H 'Content-type:application/json' -d '{ "add-runtimelib": { "name":"test", "version":1 } }' # Create custom streaming expression using work from SOLR-9103 # Patch from SOLR-10087 is required for StreamHandler to load the runtimeLib jar curl 'http://localhost:8983/solr/test/config' -H 'Content-type:application/json' -d '{ "create-expressible": { "name": "customstreamingexpression", "class": "com.test.solr.CustomStreamingExpression", "runtimeLib": true } }' # Test the custom streaming expression curl 'http://localhost:8983/solr/test/stream?expr=customstreamingexpression()'
Attachments
Attachments
Issue Links
- is related to
-
SOLR-10086 Add Streaming Expression for Kafka Streams
- Open
- relates to
-
SOLR-10105 JDBCStream should be able to load driver from runtime lib
- Open