{"id":13061,"date":"2022-04-12T10:11:38","date_gmt":"2022-04-12T17:11:38","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=13061"},"modified":"2024-05-08T07:18:22","modified_gmt":"2024-05-08T14:18:22","slug":"event-broker-integration-with-couchbase-solace-java","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/es\/event-broker-integration-with-couchbase-solace-java\/","title":{"rendered":"Integraci\u00f3n de Event Broker con Couchbase, Solace y Java"},"content":{"rendered":"<p><span style=\"font-weight: 400\">En el anterior <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/es\/event-driven-architecture-with-solace-event-broker-couchbase\/\"><span style=\"font-weight: 400\">entrada del blog<\/span><\/a><span style=\"font-weight: 400\"> hablamos de c\u00f3mo Couchbase puede integrarse perfectamente en un <\/span><i><span style=\"font-weight: 400\">Arquitectura basada en eventos<\/span><\/i><span style=\"font-weight: 400\">. Usando el Servicio de Eventos de Couchbase, las mutaciones de documentos pueden ser publicadas a un <\/span><a href=\"https:\/\/solace.com\/products\/event-broker\/software\/\"><span style=\"font-weight: 400\">Solace PubSub+<\/span><\/a><span style=\"font-weight: 400\"> desde donde los datos se ponen a disposici\u00f3n de los microservicios suscriptores casi en tiempo real.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Este post se centra en c\u00f3mo los microservicios como Topic subscribers pueden aprovechar Couchbase como un almac\u00e9n de datos escalable y resistente.<\/span><\/p>\n<p><b>Visi\u00f3n general de la arquitectura y aplicaci\u00f3n de ejemplo<\/b><\/p>\n<p><span style=\"font-weight: 400\">En este <a href=\"https:\/\/github.com\/puhhma\/cb_solace_blog_example\">solicitud de muestra<\/a>nos suscribimos a un tema Solace PubSub+, procesamos los datos y actualizamos el documento en Couchbase.<\/span><\/p>\n<p><span style=\"font-weight: 400\">En nuestra aplicaci\u00f3n de ejemplo, almacenamos los detalles del hotel en Couchbase. Las actualizaciones de la configuraci\u00f3n del hotel se publican en un tema Solace PubSub+. Construimos una aplicaci\u00f3n que se suscribe al Topic, recupera los datos actualizados y actualiza la configuraci\u00f3n del hotel existente en Couchbase.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Utilizamos el <\/span><i><span style=\"font-weight: 400\">viaje-muestra<\/span><\/i><span style=\"font-weight: 400\"> que contiene datos de muestra como <\/span><i><span style=\"font-weight: 400\">vuelos<\/span><\/i><span style=\"font-weight: 400\">, <\/span><i><span style=\"font-weight: 400\">rutas<\/span><\/i><span style=\"font-weight: 400\"> y otros. En nuestro ejemplo, nos centramos en el <\/span><i><span style=\"font-weight: 400\">hotel<\/span><\/i><span style=\"font-weight: 400\"> documentos almacenados en el <\/span><i><span style=\"font-weight: 400\">inventario<\/span><\/i><span style=\"font-weight: 400\"> \u00e1mbito en el <\/span><i><span style=\"font-weight: 400\">hotel<\/span><\/i><span style=\"font-weight: 400\"> colecci\u00f3n. Todos los documentos de hotel constan de un documento JSON con varios atributos.<\/span><\/p>\n<p><span style=\"font-weight: 400\">En este tutorial s\u00f3lo actualizaremos un peque\u00f1o subconjunto de atributos, como por ejemplo <\/span><i><span style=\"font-weight: 400\">mascotas_permitidas<\/span><\/i><span style=\"font-weight: 400\"> y <\/span><i><span style=\"font-weight: 400\">internet_libre<\/span><\/i><span style=\"font-weight: 400\">.<\/span><\/p>\n<div id=\"attachment_13062\" style=\"width: 910px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13062\" class=\"size-large wp-image-13062\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image3-1024x438.png\" alt=\"Event-driven architecture with Solace and Couchbase\" width=\"900\" height=\"385\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3-1024x438.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3-300x128.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3-768x329.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3-1536x658.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3-20x9.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3-1320x565.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image3.png 1999w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><p id=\"caption-attachment-13062\" class=\"wp-caption-text\">La aplicaci\u00f3n de ejemplo se suscribe a un Solace Topic y actualiza los datos del hotel en Couchbase. Otras aplicaciones pueden proporcionar los cambios de configuraci\u00f3n del hotel. Utilizamos un servicio simple que publica actualizaciones en el Topic.<\/p><\/div>\n<p><i><span style=\"font-weight: 400\">Leyenda: La aplicaci\u00f3n de ejemplo se suscribe a un Solace Topic y actualiza los datos del hotel en Couchbase. Otras aplicaciones pueden proporcionar los cambios de configuraci\u00f3n del hotel. Usamos un servicio simple que publica actualizaciones al Topic.<\/span><\/i><\/p>\n<h2><span style=\"font-weight: 400\">Requisitos previos<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Revise los requisitos previos para esta solicitud de muestra:<\/span><\/p>\n<p><b>Couchbase Capella<\/b><\/p>\n<p><span style=\"font-weight: 400\">Crear un <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/es\/products\/capella\/\"><span style=\"font-weight: 400\">Couchbase Capella<\/span><\/a><span style=\"font-weight: 400\"> y siga las instrucciones para aprovisionar su cl\u00faster de prueba. Esto s\u00f3lo le llevar\u00e1 unos minutos y le proporcionar\u00e1 un cl\u00faster de Couchbase completo, incluyendo los m\u00f3dulos <\/span><i><span style=\"font-weight: 400\">Datos<\/span><\/i><span style=\"font-weight: 400\"> y el conjunto de datos de muestra, <\/span><i><span style=\"font-weight: 400\">muestra-viaje,<\/span><\/i><span style=\"font-weight: 400\"> que utilizaremos a lo largo de esta entrada del blog.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Puede utilizar este tutorial cuando no utilice nuestra oferta gestionada Couchbase Capella. El <\/span><i><span style=\"font-weight: 400\">viaje-muestra<\/span><\/i><span style=\"font-weight: 400\"> bucket forma parte del producto del servidor Couchbase y puede importarse utilizando la consola de Couchbase.<\/span><\/p>\n<p><b>Nube de intermediarios de eventos Solace PubSub<\/b><\/p>\n<p><span style=\"font-weight: 400\">Inscr\u00edbete gratis <\/span><a href=\"https:\/\/solace.com\/products\/platform\/cloud\/\"><span style=\"font-weight: 400\">Prueba en la nube de Solace<\/span><\/a><span style=\"font-weight: 400\"> y crear un Servicio\/VPN. Utilizaremos la VPN para conectarnos a un tema de Solace.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-weight: 400\">Revisi\u00f3n del c\u00f3digo - Suscriptor y editor de Solace<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Para suscribirse a los mensajes de Solace Topic utilizamos la API Java de Solace. Este ejemplo de implementaci\u00f3n se deriva de los ejemplos de la documentaci\u00f3n de Solace. Para m\u00e1s detalles sobre la implementaci\u00f3n, consulte la documentaci\u00f3n de Solace.<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true\">final JCSMPProperties properties = new JCSMPProperties();\r\nproperties.setProperty(JCSMPProperties.HOST, \"tcps:\/\/yourhost.messaging.solace.cloud:55443\");\r\nproperties.setProperty(JCSMPProperties.USERNAME, \"solace-cloud-client\");\r\nproperties.setProperty(JCSMPProperties.PASSWORD, \"password\");\r\nproperties.setProperty(JCSMPProperties.VPN_NAME, \"couchbasedemo\");\r\nJCSMPSession session = JCSMPFactory.onlyInstance().createSession(properties);\r\nsession.connect();\r\n\r\nfinal Topic topic = JCSMPFactory.onlyInstance().createTopic(\"tutorial\/topic\");<\/pre>\n<p><span style=\"font-weight: 400\">Configuramos el <\/span><i><span style=\"font-weight: 400\">JCSMPProperties<\/span><\/i><span style=\"font-weight: 400\"> con la informaci\u00f3n de acceso pertinente disponible en la interfaz web de Solace. A continuaci\u00f3n, creamos un <\/span><i><span style=\"font-weight: 400\">JCSMPSession<\/span><\/i><span style=\"font-weight: 400\"> y un <\/span><i><span style=\"font-weight: 400\">Tema<\/span><\/i><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Para suscribirnos a los mensajes del Topic implementamos un <\/span><i><span style=\"font-weight: 400\">XMLMessageConsumer<\/span><\/i><span style=\"font-weight: 400\">:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true\">\/\/ ### Message Receiver - Subscribe to Topic ###\r\nfinal XMLMessageConsumer cons = session.getMessageConsumer(new XMLMessageListener() {\r\n  @Override\r\n  public void onReceive(BytesXMLMessage msg) {\r\n    if (msg instanceof TextMessage) {\r\n      System.out.printf(\"SUBSCRIBE: Message received: '%s'%n\", ((TextMessage) msg).getText());\r\n      UpdateHotelData.getInstance().upsertHotelData(((TextMessage) msg).getText());\r\n    } else {\r\n      System.out.println(\"Message received.\");\r\n    }\r\n  }\r\n\r\n  @Override\r\n  public void onException(JCSMPException e) {\r\n    System.out.printf(\"Consumer received exception: %s%n\", e);\r\n  }\r\n});\r\nsession.addSubscription(topic);\r\nSystem.out.println(\"SUBSCRIBE: Connected. Awaiting message...\");\r\ncons.start();<\/pre>\n<p>En el <i>onReceive<\/i> tomamos el mensaje, lo convertimos en una cadena y llamamos al m\u00e9todo <i>upsertHotelData<\/i> m\u00e9todo de <i>ActualizarDatosHotel <\/i>que contiene la implementaci\u00f3n de Couchbase de la que hablaremos m\u00e1s adelante.<\/p>\n<p><span style=\"font-weight: 400\">A\u00f1adimos la suscripci\u00f3n al tema a la sesi\u00f3n e iniciamos el consumidor de mensajes.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Para poder probar la implementaci\u00f3n, tambi\u00e9n creamos un publicador de mensajes. Para ello, primero implementamos un <\/span><i><span style=\"font-weight: 400\">XMLMessageProducer<\/span><\/i><span style=\"font-weight: 400\">.<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true\">\/\/ ### Message Producer - Send message to Topic\r\nXMLMessageProducer prod = session.getMessageProducer(new JCSMPStreamingPublishCorrelatingEventHandler() {\r\n  @Override\r\n  public void responseReceivedEx(Object key) {\r\n    System.out.println(\"Producer received response for msg: \" + key.toString());\r\n  }\r\n\r\n  @Override\r\n  public void handleErrorEx(Object key, JCSMPException cause, long timestamp) {\r\n    System.out.printf(\"Producer received error for msg: %s@%s - %s%n\", key.toString(), timestamp, cause);\r\n  }\r\n});<\/pre>\n<p><span style=\"font-weight: 400\">Con el productor de mensajes en su lugar, ahora podemos enviar mensajes como se ve a continuaci\u00f3n.\u00a0<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true\">\/\/ Send messages. Here we loop through and send the same message multiple times.\r\nfor (int msgsSent = 0; msgsSent &lt; 2; ++msgsSent) {\r\n  TextMessage msg = JCSMPFactory.onlyInstance().createMessage(TextMessage.class);\r\n  msg.setText(data);\r\n  System.out.printf(\"PUBLISH: Sending message '%s' to topic '%s'...%n\", data, topic.getName());\r\n  prod.send(msg, topic);\r\n  \/\/Gives us some time to follow the console logs\r\n  Thread.sleep(3000);\r\n}<\/pre>\n<h3><span style=\"font-weight: 400\">Inserci\u00f3n de los datos en Couchbase<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Con la l\u00f3gica para suscribirse y publicar mensajes en su lugar, ahora vamos a centrarnos en c\u00f3mo actualizar los documentos del hotel en Couchbase.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Para este ejemplo, supondremos que el mensaje recuperado del tema tiene el formato JSON que se indica a continuaci\u00f3n. Incluyendo un <\/span><i><span style=\"font-weight: 400\">hotel_id<\/span><\/i><span style=\"font-weight: 400\"> que utilizaremos como id de documento de los documentos del hotel almacenados en Couchbase, as\u00ed como una serie de atributos que podemos modificar:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:js decode:true\">{\r\n\u00a0\u00a0\"hotel_id\": \"hotel_10025\",\r\n\u00a0\u00a0\"pets_ok\": true,\r\n\u00a0\u00a0\"free_breakfast\": true,\r\n\u00a0\u00a0\"free_internet\": true,\r\n\u00a0\u00a0\"free_parking\": true\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">Para establecer una conexi\u00f3n segura desde nuestra aplicaci\u00f3n a Couchbase Capella, necesitamos:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Cree un usuario de base de datos y conc\u00e9dale acceso a los datos del hotel.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Lista blanca de la direcci\u00f3n IP del host que ejecuta la aplicaci\u00f3n<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Capturar la URL de conexi\u00f3n segura<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">Puedes gestionar todos estos detalles en el plano de gesti\u00f3n de Capella. <\/span><a href=\"https:\/\/cloud.couchbase.com\"><span style=\"font-weight: 400\">Conectarse a Capella<\/span><\/a><span style=\"font-weight: 400\"> en el navegador:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Abra el <\/span><b>Juicio - Cluster<\/b><span style=\"font-weight: 400\"> y vaya a la secci\u00f3n <\/span><b>Conectar <\/b><span style=\"font-weight: 400\">tab<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Despl\u00e1cese hasta el <\/span><b>Acceso a bases de datos<\/b><span style=\"font-weight: 400\"> y haga clic en <\/span><b>Gestionar credenciales<\/b><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13063\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image4-1024x377.png\" alt=\"Set database access credentials in Couchbase Capella\" width=\"900\" height=\"331\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image4-1024x377.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image4-300x110.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image4-768x283.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image4-20x7.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image4.png 1162w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/li>\n<li><span style=\"font-weight: 400\">Haga clic en <\/span><i><span style=\"font-weight: 400\">Crear credenciales de base de datos<\/span><\/i><span style=\"font-weight: 400\"> y proporcione un nombre de usuario y una contrase\u00f1a para la base de datos. Configure el nivel de acceso a la base de datos <\/span><i><span style=\"font-weight: 400\">inventario<\/span><\/i><span style=\"font-weight: 400\"> \u00e1mbito en el <\/span><i><span style=\"font-weight: 400\">viaje-muestra<\/span><\/i><span style=\"font-weight: 400\"> cubo y conceder acceso de Lectura\/Escritura.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13064\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image2-1024x1003.png\" alt=\"Set cluster database credentials in Couchbase Capella\" width=\"900\" height=\"882\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2-1024x1003.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2-300x294.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2-768x752.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2-65x65.png 65w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2-50x50.png 50w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2-20x20.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image2.png 1270w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><br \/>\n<\/span><\/li>\n<li><span style=\"font-weight: 400\">Lista blanca de la direcci\u00f3n IP de la aplicaci\u00f3n haciendo clic en <\/span><b>Gestionar IP permitidas<\/b><span style=\"font-weight: 400\"> y luego <\/span><b>A\u00f1adir IP permitida<\/b><span style=\"font-weight: 400\">. Cuando ejecute la aplicaci\u00f3n desde su m\u00e1quina local, simplemente haga clic en <\/span><b>A\u00f1adir mi IP<\/b><span style=\"font-weight: 400\"> y tu direcci\u00f3n IP externa ser\u00e1 descubierta y a\u00f1adida autom\u00e1ticamente.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13065\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/image1-1024x642.png\" alt=\"Whitelist an IP address in Couchbase Capella \" width=\"900\" height=\"564\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image1-1024x642.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image1-300x188.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image1-768x482.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image1-1536x963.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image1-20x13.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image1-1320x828.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/image1.png 1674w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><br \/>\n<\/span><\/li>\n<li><span style=\"font-weight: 400\">En el <\/span><b>Red de \u00e1rea extensa<\/b><span style=\"font-weight: 400\"> copie la URL de conexi\u00f3n.<\/span><\/li>\n<\/ol>\n<h2><span style=\"font-weight: 400\">Revisi\u00f3n del c\u00f3digo - conexi\u00f3n a Couchbase y actualizaci\u00f3n de documentos<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Nos conectamos a Couchbase Capella como primer paso creando un objeto cluster. Proporcionamos la URL del endpoint capturada en el paso anterior, as\u00ed como las credenciales de usuario de la base de datos.<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true\">\/\/ Update this to your cluster\r\nString endpoint = \"cb.8c-f5di7pqrfjy8.cloud.couchbase.com\";\r\nString username = \"dbuser\";\r\nString password = \"Passw0rd!\";\r\n\/\/ User Input ends here.\r\n\r\nString bucketName = \"travel-sample\";\r\n\r\n\/\/ Cluster Environment configuration\r\nClusterEnvironment env = ClusterEnvironment.builder()\r\n  .securityConfig(\r\n    SecurityConfig.enableTls(true).trustManagerFactory(InsecureTrustManagerFactory.INSTANCE))\r\n  .ioConfig(IoConfig.enableDnsSrv(true)).build();\r\n\r\n\/\/ Initialize the Connection and provide database user credentials\r\nCluster cluster = Cluster.connect(endpoint, ClusterOptions.clusterOptions(username, password).environment(env));\r\n\r\n\/\/ Create bucket object\r\nbucket = cluster.bucket(bucketName);\r\nbucket.waitUntilReady(Duration.parse(\"PT10S\"));\r\n\/\/ create collection object for the 'hotel' collection located in the 'inventory' scope\r\ncollection = bucket.scope(\"inventory\").collection(\"hotel\");<\/pre>\n<p><span style=\"font-weight: 400\">Una vez creado el objeto bucket, podemos recuperar el objeto <\/span><i><span style=\"font-weight: 400\">hotel<\/span><\/i><span style=\"font-weight: 400\"> y utilizarlo m\u00e1s tarde para insertar los cambios en el documento. El sitio <\/span><i><span style=\"font-weight: 400\">hotel<\/span><\/i><span style=\"font-weight: 400\"> est\u00e1 dentro del \u00e1mbito <\/span><i><span style=\"font-weight: 400\">inventario<\/span><\/i><span style=\"font-weight: 400\"> alcance de la <\/span><i><span style=\"font-weight: 400\">viaje-muestra<\/span><\/i><span style=\"font-weight: 400\"> cubo.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Tenga en cuenta que utilizo el patr\u00f3n singleton para utilizar el mismo objeto de colecci\u00f3n en todas las solicitudes posteriores. Ver el ejemplo de implementaci\u00f3n para m\u00e1s detalles en <a href=\"https:\/\/github.com\/puhhma\/cb_solace_blog_example\" target=\"_blank\" rel=\"noopener\">mi proyecto GitHub<\/a>. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Veamos ahora c\u00f3mo podemos actualizar los documentos del hotel con los datos recibidos del Tema.<\/span><\/p>\n<p><span style=\"font-weight: 400\">El mensaje recibido es un String por lo que como primer paso necesitamos convertirlo en un objeto JSON.<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true\">public void upsertHotelData(String content) {\r\n    \u2026\r\n    hotelData = JsonObject.fromJson(content);\r\n    \u2026<\/pre>\n<p><span style=\"font-weight: 400\">Dado que los datos de entrada del Tema s\u00f3lo contienen un subconjunto de todos los atributos del documento del hotel, debemos estudiar c\u00f3mo actualizar los campos del documento de la forma m\u00e1s eficaz.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">Hay dos opciones posibles:<\/span><\/p>\n<ol>\n<li style=\"list-style-type: none\">\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Utilizamos el ID del documento para recuperar el documento completo de Couchbase, actualizar los atributos y volver a escribir el documento.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Utilizamos la API de sub-documento en Couchbase para actualizar s\u00f3lo los campos dedicados dentro del documento en lugar de reemplazar todo el documento.<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">La primera opci\u00f3n se utiliza habitualmente para actualizar o insertar documentos. Sin embargo, si trabajamos con documentos m\u00e1s grandes y s\u00f3lo queremos actualizar una peque\u00f1a parte de ellos, no es necesario enviar todo el documento a trav\u00e9s de la red. En nuestra implementaci\u00f3n a continuaci\u00f3n, utilizaremos la API de subdocumento para resolver y actualizar campos en el documento del hotel.<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true\">\/\/Instead of resolving the entire document we use the sub-document API&amp;nbsp;\r\n\/\/to only resolve the relevant parts of the hotel document prior to the update.\r\n\/\/Here we can define the path to the relevant attributes of the document.\r\n\/\/In our scenario 'pets_ok' and 'free_internet' are at the document root.\r\nLookupInResult result = collection.lookupIn(hotelData.getString(\"hotel_id\"),\r\n    Arrays.asList(get(\"pets_ok\"), get(\"free_internet\")));\r\n\r\n\/\/Display the current values prior to the document update\r\nSystem.out.println(\"Values prior to update: 'pets_ok': \" +&amp;nbsp; result.contentAs(0, String.class) + \", 'free_internet': \" + result.contentAs(1, String.class));<\/pre>\n<p><span style=\"font-weight: 400\">Utilizamos el <\/span><i><span style=\"font-weight: 400\">buscarEn<\/span><\/i><span style=\"font-weight: 400\"> para consultar el documento en busca de determinadas rutas. Los distintos componentes de la ruta se separan mediante puntos (.). La direcci\u00f3n <\/span><i><span style=\"font-weight: 400\">mascotas_ok<\/span><\/i><span style=\"font-weight: 400\"> y <\/span><i><span style=\"font-weight: 400\">internet_libre <\/span><\/i><span style=\"font-weight: 400\">se encuentran en la ra\u00edz del documento. A continuaci\u00f3n, recorremos el resultado y mostramos los valores actuales.<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true\">\/\/Even here we use the sub-document API.\r\n\/\/Instead of updating the entire document we only update the relevant attributes.\r\n\/\/The UPSERT method will either update the attributes if they already exist or create them in case they do not exist in within the document\r\nMutateInResult upsertResult = collection.mutateIn(hotelData.getString(\"hotel_id\"),\r\n    Arrays.asList(upsert(\"pets_ok\", hotelData.getBoolean(\"pets_ok\")),\r\n        upsert(\"free_internet\", hotelData.getBoolean(\"free_internet\"))));<\/pre>\n<p><span style=\"font-weight: 400\">En <\/span><i><span style=\"font-weight: 400\">mutateIn<\/span><\/i><span style=\"font-weight: 400\"> permite la actualizaci\u00f3n de una o m\u00e1s rutas en un documento. Identificamos el documento en Couchbase por su ID y proporcionamos un array de rutas y valores que queremos establecer.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Por \u00faltimo, pero no por ello menos importante, ejecutamos el <\/span><i><span style=\"font-weight: 400\">buscarEn<\/span><\/i><span style=\"font-weight: 400\"> para comprobar que la actualizaci\u00f3n se ha realizado correctamente.<\/span><\/p>\n<pre class=\"decode-attributes:false lang:java decode:true\">\/\/Resolve and display the updated attributes\u00a0\u00a0\r\nLookupInResult result1 = collection.lookupIn(hotelData.getString(\"hotel_id\"),\r\n    Arrays.asList(get(\"pets_ok\"), get(\"free_internet\")));\r\nSystem.out.println(\"Values after the update: 'pets_ok': \" +\u00a0 result1.contentAs(0, String.class) + \", 'free_internet': \" + result1.contentAs(1, String.class));<\/pre>\n<h2><span style=\"font-weight: 400\">Pr\u00f3ximos pasos<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Este art\u00edculo nos ense\u00f1\u00f3 a integrar el broker de eventos Solace con Couchbase usando los SDKs Java de Couchbase y Solace.<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400\">El ejemplo de c\u00f3digo completo est\u00e1 disponible en <a href=\"https:\/\/github.com\/puhhma\/cb_solace_blog_example\" target=\"_blank\" rel=\"noopener\">mi repositorio GitHub para este proyecto<\/a>.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Aprender a enviar mensajes <em>de<\/em> Couchbase a un tema de Solace <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/es\/event-driven-architecture-with-solace-event-broker-couchbase\/\"><span style=\"font-weight: 400\">en esta entrada del blog (Parte 1)<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">M\u00e1s informaci\u00f3n <\/span><a href=\"https:\/\/docs.couchbase.com\/home\/sdk.html\"><span style=\"font-weight: 400\">SDK de Couchbase aqu\u00ed<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Utiliza el <\/span><a href=\"https:\/\/cloud.couchbase.com\/sign-up\"><span style=\"font-weight: 400\">Zona de juegos de Couchbase<\/span><\/a><span style=\"font-weight: 400\"> para empezar a desarrollarse r\u00e1pidamente.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Pruebe <\/span><a href=\"https:\/\/solace.com\/products\/platform\/cloud\/\"><span style=\"font-weight: 400\">Solace PubSub+ Nube<\/span><\/a><span style=\"font-weight: 400\"> con un juicio.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Empiece a utilizar Couchbase hoy mismo con el <\/span><a href=\"https:\/\/cloud.couchbase.com\/\"><span style=\"font-weight: 400\">Base de datos en la nube Couchbase Capella<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>In the previous blog post we discussed how Couchbase can seamlessly integrate into an Event-Driven Architecture. Using the Couchbase Eventing Service, document mutations can be published to a Solace PubSub+ queue from where the data is made available to subscribing [&hellip;]<\/p>","protected":false},"author":77950,"featured_media":13023,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1814,2225,1818,2201],"tags":[1311,9564,9566,9565],"ppma_author":[9323],"class_list":["post-13061","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-design","category-cloud","category-java","category-tools-sdks","tag-architecture","tag-event-driven","tag-pubsub","tag-solace"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.2 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Event Broker Integration with Couchbase, Solace &amp; Java<\/title>\n<meta name=\"description\" content=\"Following up from an earlier post, learn to pull events from Solace PubSub topics to update a Couchbase datastore using a Java-based microservice.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/es\/event-broker-integration-with-couchbase-solace-java\/\" \/>\n<meta property=\"og:locale\" content=\"es_MX\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Event Broker Integration with Couchbase, Solace &amp; Java\" \/>\n<meta property=\"og:description\" content=\"Following up from an earlier post, learn to pull events from Solace PubSub topics to update a Couchbase datastore using a Java-based microservice.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/es\/event-broker-integration-with-couchbase-solace-java\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-12T17:11:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-08T14:18:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/mobile-code-edit-vscode-couchbase-lite-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1704\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Marian Puhl, Senior Solutions Engineer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marian Puhl, Senior Solutions Engineer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/\"},\"author\":{\"name\":\"Marian Puhl, Senior Solutions Engineer\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/b2fc479528e2819b50082a425cf381e3\"},\"headline\":\"Event Broker Integration with Couchbase, Solace &#038; Java\",\"datePublished\":\"2022-04-12T17:11:38+00:00\",\"dateModified\":\"2024-05-08T14:18:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/\"},\"wordCount\":1247,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/mobile-code-edit-vscode-couchbase-lite-scaled.jpg\",\"keywords\":[\"Architecture\",\"event-driven\",\"pubsub\",\"solace\"],\"articleSection\":[\"Application Design\",\"Couchbase Capella\",\"Java\",\"Tools &amp; SDKs\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/\",\"name\":\"Event Broker Integration with Couchbase, Solace & Java\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/mobile-code-edit-vscode-couchbase-lite-scaled.jpg\",\"datePublished\":\"2022-04-12T17:11:38+00:00\",\"dateModified\":\"2024-05-08T14:18:22+00:00\",\"description\":\"Following up from an earlier post, learn to pull events from Solace PubSub topics to update a Couchbase datastore using a Java-based microservice.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/mobile-code-edit-vscode-couchbase-lite-scaled.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/mobile-code-edit-vscode-couchbase-lite-scaled.jpg\",\"width\":2560,\"height\":1704,\"caption\":\"Consume events from Solace into Couchbase\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Event Broker Integration with Couchbase, Solace &#038; Java\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/b2fc479528e2819b50082a425cf381e3\",\"name\":\"Marian Puhl, Senior Solutions Engineer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/1f65549252c18bb3651eaa3a78e46169\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/07\/marian-puhl-couchbase-engineering.jpeg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/07\/marian-puhl-couchbase-engineering.jpeg\",\"caption\":\"Marian Puhl, Senior Solutions Engineer\"},\"description\":\"Marian Puhl is a Senior Solutions Engineer at Couchbase in the Nordic region.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/es\/author\/marian-puhl\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Event Broker Integration with Couchbase, Solace & Java","description":"Como continuaci\u00f3n de un post anterior, aprenda a extraer eventos de temas Solace PubSub para actualizar un almac\u00e9n de datos Couchbase utilizando un microservicio basado en Java.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/es\/event-broker-integration-with-couchbase-solace-java\/","og_locale":"es_MX","og_type":"article","og_title":"Event Broker Integration with Couchbase, Solace & Java","og_description":"Following up from an earlier post, learn to pull events from Solace PubSub topics to update a Couchbase datastore using a Java-based microservice.","og_url":"https:\/\/www.couchbase.com\/blog\/es\/event-broker-integration-with-couchbase-solace-java\/","og_site_name":"The Couchbase Blog","article_published_time":"2022-04-12T17:11:38+00:00","article_modified_time":"2024-05-08T14:18:22+00:00","og_image":[{"width":2560,"height":1704,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/04\/mobile-code-edit-vscode-couchbase-lite-scaled.jpg","type":"image\/jpeg"}],"author":"Marian Puhl, Senior Solutions Engineer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Marian Puhl, Senior Solutions Engineer","Est. reading time":"7 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/"},"author":{"name":"Marian Puhl, Senior Solutions Engineer","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/b2fc479528e2819b50082a425cf381e3"},"headline":"Event Broker Integration with Couchbase, Solace &#038; Java","datePublished":"2022-04-12T17:11:38+00:00","dateModified":"2024-05-08T14:18:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/"},"wordCount":1247,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/mobile-code-edit-vscode-couchbase-lite-scaled.jpg","keywords":["Architecture","event-driven","pubsub","solace"],"articleSection":["Application Design","Couchbase Capella","Java","Tools &amp; SDKs"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/","url":"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/","name":"Event Broker Integration with Couchbase, Solace & Java","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/mobile-code-edit-vscode-couchbase-lite-scaled.jpg","datePublished":"2022-04-12T17:11:38+00:00","dateModified":"2024-05-08T14:18:22+00:00","description":"Como continuaci\u00f3n de un post anterior, aprenda a extraer eventos de temas Solace PubSub para actualizar un almac\u00e9n de datos Couchbase utilizando un microservicio basado en Java.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/mobile-code-edit-vscode-couchbase-lite-scaled.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/04\/mobile-code-edit-vscode-couchbase-lite-scaled.jpg","width":2560,"height":1704,"caption":"Consume events from Solace into Couchbase"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/event-broker-integration-with-couchbase-solace-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Event Broker Integration with Couchbase, Solace &#038; Java"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"El blog de Couchbase","description":"Couchbase, la base de datos NoSQL","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"El blog de Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/b2fc479528e2819b50082a425cf381e3","name":"Marian Puhl, Senior Solutions Engineer","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/1f65549252c18bb3651eaa3a78e46169","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/07\/marian-puhl-couchbase-engineering.jpeg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/07\/marian-puhl-couchbase-engineering.jpeg","caption":"Marian Puhl, Senior Solutions Engineer"},"description":"Marian Puhl is a Senior Solutions Engineer at Couchbase in the Nordic region.","url":"https:\/\/www.couchbase.com\/blog\/es\/author\/marian-puhl\/"}]}},"authors":[{"term_id":9323,"user_id":77950,"is_guest":0,"slug":"marian-puhl","display_name":"Marian Puhl, Senior Solutions Engineer","avatar_url":{"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/07\/marian-puhl-couchbase-engineering.jpeg","url2x":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/07\/marian-puhl-couchbase-engineering.jpeg"},"author_category":"1","last_name":"Puhl, Senior Solutions Engineer","first_name":"Marian","job_title":"","user_url":"","description":"Marian Puhl is a Senior Solutions Engineer at Couchbase in the Nordic region."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/posts\/13061","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/users\/77950"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/comments?post=13061"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/posts\/13061\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/media\/13023"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/media?parent=13061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/categories?post=13061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/tags?post=13061"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/ppma_author?post=13061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}