[id='enabling-resp-endpoint_{context}']
= {brandname} RESP endpoint

The RESP endpoint is enabled by default on the single-port endpoint. Redis client connections will automatically be detected and routed to the internal connector.
The RESP endpoint works with:

* Standalone {brandname} Server deployments, exactly like standalone Redis, where each server instance runs independently of each other.
* Clustered {brandname} Server deployments, where server instances replicate or distribute data between each other. Clustered deployments provides clients with failover capabilities.

.Prerequisites

* Install {brandname} Server.

.Procedure

. link:{server_docs}#creating-users_server-getting-started[Create a user]

.Verification

When you start {brandname} Server check for the following log message:

[source,options="nowrap"]
----
[org.infinispan.SERVER] ISPN080018: Started connector Resp (internal)
----

You can now connect to the RESP endpoint with a Redis client.
For example, with the Redis CLI you can do the following to add an entry to the cache:

[source,options="nowrap"]
----
redis-cli -p 11222 --user username --pass password
----

[source,options="nowrap"]
----
127.0.0.1:11222> SET k v
OK
127.0.0.1:11222> GET k
"v"
127.0.0.1:11222> quit
----

== Configuring caches for the RESP endpoint

The RESP endpoint automatically configures and starts a `respCache` cache. This cache has the following configuration:

* `local-cache` or `distributed-cache` depending on the {brandname} Server clustering mode.
* `application/octet-stream` encoding for both keys and values.
* `RESPHashFunctionPartitioner` hash partitioner, which supports the CRC16 hashing used by Redis clients

The cache configuration cannot enable capabilities that violate the RESP protocol.
For example, specifying an incompatible hash partitioning function or a key encoding different from `application/octet-stream`.

[TIP]
====
Configure your cache value encoding with Protobuf encoding if you want to view cache entries in the {brandname} Console (`value media-type="application/x-protostream"`).
====

[discrete]
=== RESP endpoint configuration

If the implicit configuration used by the single-port endpoint does not fit your needs, use explicit configuration.

.XML
[source,xml,options="nowrap",subs=attributes+,role="primary"]
----
include::xml/resp_connector.xml[]
----

.JSON
[source,json,options="nowrap",subs=attributes+,role="secondary"]
----
include::json/resp_connector.json[]
----

.YAML
[source,yaml,options="nowrap",subs=attributes+,role="secondary"]
----
include::yaml/resp_connector.yaml[]
----
