有没有机会使用2.0+ java api连接到CouchbaseMock?

时间:2017-03-13 13:41:34

标签: couchbase

前段时间很多人都在问这个问题,我很高兴知道是否有机会支持这个问题?我真的不想从漂亮的rx.java api辞职,以便能够在本地运行我的集成测试。

  1. 有人使用java api 2.0成功连接CouchbaseMock吗?
  2. 对于Couchbase相关人员:未来是否有计划支持此事?
  3. 是否有其他Couchbase模拟实现,可能是用不同的语言?
  4. 从我上次尝试中附加日志,看起来api正在抛出NPE。

    > Mar 14, 2017 10:04:39 AM com.couchbase.client.core.CouchbaseCore
    > <init> INFO: CouchbaseEnvironment: {sslEnabled=false,
    > sslKeystoreFile='null', sslKeystorePassword=false, sslKeystore=null,
    > bootstrapHttpEnabled=true, bootstrapCarrierEnabled=true,
    > bootstrapHttpDirectPort=7777, bootstrapHttpSslPort=18091,
    > bootstrapCarrierDirectPort=55001, bootstrapCarrierSslPort=11207,
    > ioPoolSize=8, computationPoolSize=8, responseBufferSize=16384,
    > requestBufferSize=16384, kvServiceEndpoints=1,
    > viewServiceEndpoints=12, queryServiceEndpoints=12,
    > searchServiceEndpoints=12, ioPool=NioEventLoopGroup, kvIoPool=null,
    > viewIoPool=null, searchIoPool=null, queryIoPool=null,
    > coreScheduler=CoreScheduler,
    > memcachedHashingStrategy=DefaultMemcachedHashingStrategy,
    > eventBus=DefaultEventBus,
    > packageNameAndVersion=couchbase-java-client/2.4.2 (git: 2.4.2, core:
    > 1.4.2), dcpEnabled=false, retryStrategy=BestEffort, maxRequestLifetime=75000, retryDelay=ExponentialDelay{growBy 1.0
    > MICROSECONDS, powers of 2; lower=100, upper=100000},
    > reconnectDelay=ExponentialDelay{growBy 1.0 MILLISECONDS, powers of 2;
    > lower=32, upper=4096}, observeIntervalDelay=ExponentialDelay{growBy
    > 1.0 MICROSECONDS, powers of 2; lower=10, upper=100000}, keepAliveInterval=30000, autoreleaseAfter=2000,
    > bufferPoolingEnabled=true, tcpNodelayEnabled=true,
    > mutationTokensEnabled=false, socketConnectTimeout=1000,
    > dcpConnectionBufferSize=20971520, dcpConnectionBufferAckThreshold=0.2,
    > dcpConnectionName=dcp/core-io, callbacksOnIoPool=false,
    > disconnectTimeout=25000,
    > requestBufferWaitStrategy=com.couchbase.client.core.env.DefaultCoreEnvironment$2@7d3a22a9,
    > queryTimeout=75000, viewTimeout=75000, kvTimeout=2500,
    > connectTimeout=5000, dnsSrvEnabled=false} Mar 14, 2017 10:04:40 AM
    > com.couchbase.client.core.node.CouchbaseNode signalConnected INFO:
    > Connected to Node 127.0.0.1 Mar 14, 2017 10:04:40 AM
    > com.couchbase.client.core.endpoint.AbstractGenericHandler
    > exceptionCaught WARNING: [/127.0.0.1:55001][KeyValueEndpoint]: Caught
    > unknown exception: java.lang.NullPointerException
    > com.couchbase.client.deps.io.netty.handler.codec.DecoderException:
    > java.lang.NullPointerException    at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:98)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    >   at
    > com.couchbase.client.deps.io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:643)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:566)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442)
    >   at
    > com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
    >   at
    > com.couchbase.client.deps.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    >   at java.lang.Thread.run(Thread.java:745) Caused by:
    > java.lang.NullPointerException    at
    > com.couchbase.client.core.endpoint.AbstractGenericHandler.decode(AbstractGenericHandler.java:266)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
    >   ... 31 more
    > 
    > Mar 14, 2017 10:04:40 AM
    > com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline
    > onUnhandledInboundException WARNING: An exceptionCaught() event was
    > fired, and it reached at the tail of the pipeline. It usually means
    > the last handler in the pipeline did not handle the exception.
    > com.couchbase.client.deps.io.netty.handler.codec.DecoderException:
    > java.lang.NullPointerException    at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:98)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    >   at
    > com.couchbase.client.deps.io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:643)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:566)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442)
    >   at
    > com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
    >   at
    > com.couchbase.client.deps.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    >   at java.lang.Thread.run(Thread.java:745) Caused by:
    > java.lang.NullPointerException    at
    > com.couchbase.client.core.endpoint.AbstractGenericHandler.decode(AbstractGenericHandler.java:266)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
    >   ... 31 more
    > 
    > Mar 14, 2017 10:04:40 AM
    > com.couchbase.client.core.endpoint.AbstractGenericHandler
    > exceptionCaught WARNING: [/127.0.0.1:55001][KeyValueEndpoint]: Caught
    > unknown exception: java.lang.NullPointerException
    > com.couchbase.client.deps.io.netty.handler.codec.DecoderException:
    > java.lang.NullPointerException    at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:98)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    >   at
    > com.couchbase.client.deps.io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:643)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:566)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442)
    >   at
    > com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
    >   at
    > com.couchbase.client.deps.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    >   at java.lang.Thread.run(Thread.java:745) Caused by:
    > java.lang.NullPointerException    at
    > com.couchbase.client.core.endpoint.AbstractGenericHandler.decode(AbstractGenericHandler.java:266)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
    >   ... 31 more
    > 
    > Mar 14, 2017 10:04:40 AM
    > com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline
    > onUnhandledInboundException WARNING: An exceptionCaught() event was
    > fired, and it reached at the tail of the pipeline. It usually means
    > the last handler in the pipeline did not handle the exception.
    > com.couchbase.client.deps.io.netty.handler.codec.DecoderException:
    > java.lang.NullPointerException    at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:98)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    >   at
    > com.couchbase.client.deps.io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
    >   at
    > com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
    >   at
    > com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
    >   at
    > com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:643)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:566)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480)
    >   at
    > com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442)
    >   at
    > com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
    >   at
    > com.couchbase.client.deps.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    >   at java.lang.Thread.run(Thread.java:745) Caused by:
    > java.lang.NullPointerException    at
    > com.couchbase.client.core.endpoint.AbstractGenericHandler.decode(AbstractGenericHandler.java:266)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81)
    >   at
    > com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
    >   ... 31 more
    > 
    > Exception in thread "main" java.lang.RuntimeException:
    > java.util.concurrent.TimeoutException     at
    > com.couchbase.client.core.utils.Blocking.blockForSingle(Blocking.java:74)
    >   at
    > com.couchbase.client.java.CouchbaseCluster.openBucket(CouchbaseCluster.java:310)
    >   at
    > com.couchbase.client.java.CouchbaseCluster.openBucket(CouchbaseCluster.java:288)
    >   at
    > com.couchbase.client.java.CouchbaseCluster.openBucket(CouchbaseCluster.java:278)
    >   at
    > com.couchbase.client.java.CouchbaseCluster.openBucket(CouchbaseCluster.java:262)
    >   at com.mycompany.ohsm.io.Test.main(Test.java:27) Caused by:
    > java.util.concurrent.TimeoutException     ... 6 more
    

    模拟服务器(1.4.4):

    final CouchbaseMock couchbaseMock =
                    new CouchbaseMock("localhost", 7777, 1, 0, 1024, "couchbase::memcache", 0);
            couchbaseMock.start();
            couchbaseMock.waitForStartup();
    

    客户(2.4.2):

    final DefaultCouchbaseEnvironment env = DefaultCouchbaseEnvironment.builder().
                    bootstrapCarrierEnabled(true).
                    bootstrapHttpEnabled(true).
                    bootstrapHttpDirectPort(7777).
                    sslEnabled(false).
                    bootstrapCarrierDirectPort(55001).
                    build();
    
            CouchbaseCluster couchbaseCluster = CouchbaseCluster.create(env, "127.0.0.1");
    
    
            final Bucket couchbase = couchbaseCluster.openBucket("couchbase");
            final JsonDocument doc = couchbase.get("key");
    

2 个答案:

答案 0 :(得分:1)

  1. 我不知道有什么理由不行,但我会请一些同事加入这个。
  2. 目前,CouchbaseMock是一个维护项目,对很多这些案例很有用,但我们并不打算在短期内成为一个完整的模拟器。相反,我们想要消除使用集群或类似集群的障碍。
  3. 没有什么是完整的。

答案 1 :(得分:1)

我看到你的java客户端CouchbaseEnvironment的memcached端口为55001,不确定你是如何在mock上设置它的。我刚尝试使用2.x java客户端和mock进行基本操作,它们运行良好。