You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/12/19 19:25:33 UTC

[GitHub] michael-card opened a new issue #3220: Pulsar Java admin client should work with URL that points to a load balancer

michael-card opened a new issue #3220: Pulsar Java admin client should work with URL that points to a load balancer
URL: https://github.com/apache/pulsar/issues/3220
 
 
   #### Expected behavior
   
   When creating an instance of the Java Pulsar administrative client like this:
   
   ```
   admin = PulsarAdmin.builder().serviceHttpUrl(pulsarAdminUrl).build();
   ```
   
   it should be possible to supply a URL that references a load balancer e.g.
   
   ```
   http://emodb-pulsar-databus-pulsar-cluster-1:8080
   ```
   
   #### Actual behavior
   
   If you do this however the admin client cannot communicate correctly with Pulsar and you will get unexepected end-of-file errors when trying to use the admin client to create topics etc. For example, in some of my code I try to create partitioned topics like this:
   
   ```
                   try {admin.topics().createPartitionedTopic(FULL_MASTER_QUEUE_TOPIC_NAME, NUM_PARTITIONS); } catch (Throwable t) { _log.error("DefaultDatabus.constructor: caught exception " + t.getClass().getName() + " creating " + FULL_MASTER_QUEUE_TOPIC_NAME + ", message = " + t.getMessage());}
                   try {admin.topics().createPartitionedTopic(FULL_RESOLVER_QUEUE_TOPIC_NAME, NUM_PARTITIONS); } catch (Throwable t) { _log.error("DefaultDatabus.constructor: caught exception " + t.getClass().getName() + " creating " + FULL_RESOLVER_QUEUE_TOPIC_NAME + ", message = " + t.getMessage());}
                   try {admin.topics().createPartitionedTopic(FULL_RESOLVER_RETRY_QUEUE_TOPIC_NAME, NUM_PARTITIONS); } catch (Throwable t) { _log.error("DefaultDatabus.constructor: caught exception " + t.getClass().getName() + " creating " + FULL_RESOLVER_RETRY_QUEUE_TOPIC_NAME + ", message = " + t.getMessage());}
   ```
   
   and this results in these errors appearing in the logs:
   
   ```
   WARN  [2018-12-19 16:21:41,643] org.apache.pulsar.client.admin.internal.BaseResource: [http://emodb-pulsar-databus-pulsar-cluster-1:8080/admin/v2/persistent/public/default/master-queue/partitions] Failed to perform http put request: java.net.SocketException: Unexpected end of file from server
   ERROR [2018-12-19 16:21:41,643] com.bazaarvoice.emodb.databus.core.DefaultDatabus: DefaultDatabus.constructor: caught exception org.apache.pulsar.client.admin.PulsarAdminException creating public/default/master-queue, message = java.net.SocketException: Unexpected end of file from server
   WARN  [2018-12-19 16:21:41,649] org.apache.pulsar.client.admin.internal.BaseResource: [http://emodb-pulsar-databus-pulsar-cluster-1:8080/admin/v2/persistent/public/default/resolver-queue/partitions] Failed to perform http put request: java.net.SocketException: Unexpected end of file from server
   ERROR [2018-12-19 16:21:41,649] com.bazaarvoice.emodb.databus.core.DefaultDatabus: DefaultDatabus.constructor: caught exception org.apache.pulsar.client.admin.PulsarAdminException creating public/default/resolver-queue, message = java.net.SocketException: Unexpected end of file from server
   WARN  [2018-12-19 16:21:41,654] org.apache.pulsar.client.admin.internal.BaseResource: [http://emodb-pulsar-databus-pulsar-cluster-1:8080/admin/v2/persistent/public/default/resolver-retry-queue/partitions] Failed to perform http put request: java.net.SocketException: Unexpected end of file from server
   ERROR [2018-12-19 16:21:41,654] com.bazaarvoice.emodb.databus.core.DefaultDatabus: DefaultDatabus.constructor: caught exception org.apache.pulsar.client.admin.PulsarAdminException creating public/default/resolver-retry-queue, message = java.net.SocketException: Unexpected end of file from server
   ```
   
   #### Steps to reproduce
   
   1. Set up a Pulsar cluster in AWS
   2. Create an ELB for your Pulsar cluster that listens on ports 6650 and 8080
   3. Create a Route53 record set that provides an alias that points to your ELB
   4. In some Java code use the URL you set up in Route53 to create an admin client
   5. Attempt to perform an admin function like creating a topic using your client, you should see an end-of-file exception propagating up from the call
   6. Replace the URL that points to the ELB with a URL containing the IP address of one of the Pulsar cluster's broker nodes and use that to create the admin client
   7. Now try to create the topic, it should work without errors
   
   #### System configuration
   **Pulsar version**: 2.2.0
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services