Configuring the search client in Content Deployer
Modify the client configuration file, cd_client_conf.xml , to configure the interaction between Content Deployer and to the IQ Query microservice . In this file, you can specify configuration strings as hardcoded values or as parameters.
About this task
Procedure
- On your Content Delivery server environment, access the configuration location of your Content Deployer.
- By default, the Discovery Service is assumed to be running on the same machine as the Content Deployer microservice, on the default port, 8082 with default Discovery Service URL: http://localhost:8082/discovery.svc. If the Discovery Service runs on a different host or uses a different port (or both), set an environment variable called
discoveryurlto that URL. - By default, the Token Service is assumed to be accessible through the
cduseraccount, using the default password. Do one or both of the following:- If you are using a different user account to connect to the Token Service, in the file cd_client_conf.xml , set the value of the
ClientIdattribute of theTokenServiceelement to either that user account name, or to a string of the format${ENVVAR}, where ENVVAR is the name of an environment variable whose value is the account name, and save your changes to the file. - If you are using a different password to connect to the Token Service (and RWS strongly recommends that you do), create an environment variable called
cduserpassword, set to the encrypted version of that password.
- If you are using a different user account to connect to the Token Service, in the file cd_client_conf.xml , set the value of the
- RWS strongly recommends entering any sensitive strings, such as passwords, in encrypted form. You can obtain the encrypted form of a sensitive string by doing the following:
- In a command shell, navigate to a location that contains the files udp-core-BUILD.jar and udp-common-util-BUILD.jar, where
BUILDis the JAR file's build number. For example, you can find these files on the installation media in the folder Content Delivery\roles\api\rest\java\lib\ - Depending on your operating system, enter one of the following commands:
- Windows operating systems
-
java -cp udp-core-BUILD.jar;udp-common-util-BUILD.jar com.tridion.crypto.Encrypt INPUT - Unix operating systems
-
java -cp udp-core-BUILD.jar:udp-common-util-BUILD.jar com.tridion.crypto.Encrypt INPUTwhere INPUT is the unencrypted string. (You may wish to redirect output to a file for easy copy-pasting of the tool's response.)
The tool returns the following kind of response:Configuration value = encrypted:9FUJ9CP81Oj63VhnJxcqx//pW3fP4bekeupIexctzcs=where the encrypted string is
encrypted:9FUJ9CP81Oj63VhnJxcqx//pW3fP4bekeupIexctzcs=
- In a command shell, navigate to a location that contains the files udp-core-BUILD.jar and udp-common-util-BUILD.jar, where
- If you want to change the timeouts for this client, you can set the following environment variables:
Environment variable Description Default indexconnectiontimeoutThe time (in milliseconds) after which the connection is considered to have timed out 10000 indexreadtimeoutThe time (in milliseconds) after which an attempt to read from a socket is considered to have timed out 30000 indexwritetimeoutThe time (in milliseconds) after which an attempt to write to a socket is considered to have timed out 30000 indexmaxidleconnectionsThe maximum allowed number of idle connections 30 - RWS strongly recommends that you register all your microservices as Capabilities with the Discovery Service. Only if, for some reason, you have not registered the Index Service as a Capability, you can directly configure the URLs for this service in this client configuration file. To configure the IQ Index Service URL, ensure the presence of an
IndexServiceelement within theServiceConfigelement, with aServiceUriattribute set to either a hardcoded URL of the service, or to a string of the format${ENVVAR}, where ENVVAR is the name of an environment variable whose value is the URL of the IQ index service. The IQ Index service URL has the form http://HOST:PORT/index.svc, where HOST is the name of the host machine on which the service runs, and PORT is the port number of the service (defaults to 8097).For example, the configuration for the service URL using direct URLs can look like this:<?xml version="1.0" encoding="UTF-8"?> <ServiceConfig ....> <!-- The location of Index service. Used when Index Service capability was not registered in a discovery service. --> <IndexService ServiceUri="http://localhost:8097/index.svc"/> </ServiceConfig> - If, for some reason, your Elasticsearch index for indexing does not have the default name
udp-index, ensure the presence of aDefaultIndexelement within theServiceConfigelement, with anIndexNameattribute set to either a hardcoded custom index name, or to a string of the format${ENVVAR}, where ENVVAR is the name of an environment variable whose value is your custom index name. - If, for some reason, you want to use a custom indexing client, different from the one supplied by RWS, com.sdl.delivery.iq.index.client.DefaultIndexingClient, ensure the presence of an
IndexClientelement within theServiceConfigelement, with aClassattribute set to either a hardcoded fully qualified Java classname of your custom class, or to a string of the format${ENVVAR}, where ENVVAR is the name of an environment variable whose value is the fully qualified Java classname of your custom class. - If you've modified, cd_client_conf.xml , save and close it.
Related reference