use of org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller in project camel by apache.
the class InfinispanContinuousQueryIT method doPreSetup.
@Override
protected void doPreSetup() throws IOException {
ConfigurationBuilder builder = new ConfigurationBuilder().addServer().host("localhost").port(11222).marshaller(new ProtoStreamMarshaller());
manager = new RemoteCacheManager(builder.build());
RemoteCache<String, String> metadataCache = manager.getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME);
metadataCache.put("sample_bank_account/bank.proto", Util.read(InfinispanContinuousQueryIT.class.getResourceAsStream("/sample_bank_account/bank.proto")));
MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(manager));
SerializationContext serCtx = ProtoStreamMarshaller.getSerializationContext(manager);
serCtx.registerProtoFiles(FileDescriptorSource.fromResources("/sample_bank_account/bank.proto"));
serCtx.registerMarshaller(new UserMarshaller());
serCtx.registerMarshaller(new GenderMarshaller());
// pre-load data
cache = manager.getCache("remote_query");
cache.clear();
}
use of org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller in project camel by apache.
the class InfinispanRemoteQueryProducerIT method doPreSetup.
@Override
protected void doPreSetup() throws IOException {
ConfigurationBuilder builder = new ConfigurationBuilder().addServer().host("localhost").port(11222).marshaller(new ProtoStreamMarshaller());
manager = new RemoteCacheManager(builder.build());
RemoteCache<String, String> metadataCache = manager.getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME);
metadataCache.put("sample_bank_account/bank.proto", Util.read(InfinispanRemoteQueryProducerIT.class.getResourceAsStream("/sample_bank_account/bank.proto")));
MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(manager));
SerializationContext serCtx = ProtoStreamMarshaller.getSerializationContext(manager);
serCtx.registerProtoFiles(FileDescriptorSource.fromResources("/sample_bank_account/bank.proto"));
serCtx.registerMarshaller(new UserMarshaller());
serCtx.registerMarshaller(new GenderMarshaller());
}
Aggregations