Predix_Logo
  • Categories
    • Questions
    • Predix | Updates
      • Pricing
      • Product
    • Deloitte - Private
    • How-To
    • Accenture-Private
  • Explore
    • Topics
    • Questions
    • Articles
    • Feedback or Feature Requests
  • Sign in
  • Home /
  • Questions /
avatar image
0
Question by Dan Salt · May 10, 2017 at 12:59 PM · time-series-servicejavaAPMapm-timeseries

Timeseries Java Client always returns 'null' for ingestion response/status

I'm using version 0.0.8 of the TimeSeries Java Client to ingest data.

The calls work fine (data is appearing in the Timeseries Instance), but the Java Client always returns an IngestionResponse with 'null' values. Looking through the decompiled source (in IntelliJ) it looks like it's returning a valid JSON response, but then throwing a (caught) NullPointerException because the Response isn't in the PendingIngestionsMap.

In ClientFactory.java

     private synchronized Set<MessageHandler> getMessageHandlers() {
         if(null == this.messageHandlers) {
             this.messageHandlers = new HashSet();
             this.messageHandlers.add(new Whole<String>() {
                 private Logger logger = LoggerFactory.getLogger(Whole.class);

                 public void onMessage(String message) {
                     this.logger.info("Received message: " + message);
                     IngestionResponse resp = (IngestionResponse)(new Gson()).fromJson(message, IngestionResponse.class);
                     IngestionResponse response = (IngestionResponse)PredixTimeseriesWebSocketIngestionClient.this.pendingIngestionsMap.get(resp.getMessageId());
                     response.setMessageId(resp.getMessageId());
                     response.setStatusCode(resp.getStatusCode());
                     response.getLatch().countDown();
                 }
             });
         }

         return this.messageHandlers;
     }

Is anyone else seeing this behaviour?

Cheers, Dan

Comment
Add comment
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
0

Answer by Thuan Truong · May 10, 2017 at 03:42 PM

Hi @Dan Salt,

You need to set ingestion wait timeout in tenant context in order to receive the response (by default it the timeout is 0, so you always got the null response).

tenant.setIngestionWaitTimeout(ingestionWaitTimeout);

If you create the tenant context by this method TenantContextFactory.createTenantContextFromPropertiesFile(), you can specify the ingestion wait timeout property:

ingestion.response.wait.timeout

Thanks,

Thuan

Comment
Add comment · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

76 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

help on Ingesting data from Predix machine to APM Timeseries 2 Answers

Java TOP command usage with mini Field Agent 16.2.2 stack 1 Answer

Can we read customer's DCS text tags in Predix T/S and pull via APM asset model? 2 Answers

Time Series Java Client Library link error (Dex cannot parse version 52 byte code) with gradle or Android Things. JDK 1.8 1 Answer

Ingesting data to Time Series via Proxy 2 Answers

GE Monogram
  • Legal
  • Cookies
  • Forum Terms
  • Contact Us
  • Copyright © 2017 General Electric Company. All rights reserved.


Enterprise
Social Q&A

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Submit your feedback or feature request
  • Categories
  • Questions
  • Predix | Updates
    • Pricing
    • Product
  • Deloitte - Private
  • How-To
  • Accenture-Private
  • Explore
  • Topics
  • Questions
  • Articles
  • Feedback or Feature Requests