Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message: listener timeout after waiting for [30000] ms #30

Open
Nagarajmspace opened this issue May 29, 2018 · 1 comment
Open

Message: listener timeout after waiting for [30000] ms #30

Nagarajmspace opened this issue May 29, 2018 · 1 comment

Comments

@Nagarajmspace
Copy link

Nagarajmspace commented May 29, 2018

I am trying to implement simple CRUD operation on Elasticsearch using groovy and grails
some time i am able to create an index and some time i am getting below mentioned exception that is time out, i have trying some many way non of them are working fine. i stuck here can some help me to get out from this.
below the exception i have attached the code which i am using here, please go through it and check whether it is correct or not
thank you for your help in advance

Error |
2018-05-29 23:13:18,320 [http-bio-8080-exec-10] ERROR errors.GrailsExceptionResolver - IOException occurred when processing request: [GET] /Sharama1/person/addPerson
listener timeout after waiting for [30000] ms. Stacktrace follows:
Message: listener timeout after waiting for [30000] ms
Line | Method
->> 661 | get in org.elasticsearch.client.RestClient$SyncResponseListener


| 220 | performRequest in org.elasticsearch.client.RestClient
| 192 | performRequest . . . . . . . . . . . in ''
| 428 | performRequest in org.elasticsearch.client.RestHighLevelClient
| 414 | performRequestAndParseEntity . . . . in ''
| 299 | index in ''
| -2 | invoke0 . . . . . . . . . . . . . . . in sun.reflect.NativeMethodAccessorImpl
| 62 | invoke in ''
| 43 | invoke . . . . . . . . . . . . . . . in sun.reflect.DelegatingMethodAccessorImpl
| 497 | invoke in java.lang.reflect.Method
| 1426 | jlrMethodInvoke . . . . . . . . . . . in org.springsource.loaded.ri.ReflectiveInterceptor
| 189 | invoke in org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite
| 53 | call . . . . . . . . . . . . . . . . in org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite
| 45 | defaultCall in org.codehaus.groovy.runtime.callsite.CallSiteArray
| 108 | call . . . . . . . . . . . . . . . . in org.codehaus.groovy.runtime.callsite.AbstractCallSite
| 116 | call in ''
| 70 | doCall . . . . . . . . . . . . . . . in sharama1.PersonController$_closure3
| -1 | doCall in ''
| -2 | invoke0 . . . . . . . . . . . . . . . in sun.reflect.NativeMethodAccessorImpl
| 62 | invoke in ''
| 43 | invoke . . . . . . . . . . . . . . . in sun.reflect.DelegatingMethodAccessorImpl
| 497 | invoke in java.lang.reflect.Method
| 1426 | jlrMethodInvoke . . . . . . . . . . . in org.springsource.loaded.ri.ReflectiveInterceptor
| 90 | invoke in org.codehaus.groovy.reflection.CachedMethod
| 233 | doMethodInvoke . . . . . . . . . . . in groovy.lang.MetaMethod
| 1086 | invokeMethod in groovy.lang.MetaClassImpl
| 1110 | invokeMethod . . . . . . . . . . . . in groovy.lang.ExpandoMetaClass
| 910 | invokeMethod in groovy.lang.MetaClassImpl
| 411 | call . . . . . . . . . . . . . . . . in groovy.lang.Closure
| -1 | call in sharama1.PersonController$_closure3

=====================
Code for Creating an index

def addPerson={
RestHighLevelClient client=ESService.getClient()
Map<String,Object> jsonMap = new HashMap<>();
jsonMap.put("firstName","abcd");
jsonMap.put("lastName","xyz");
jsonMap.put("date",new Date());
jsonMap.put("message","Hugh data Index mapping");
IndexRequest indexRequest = new IndexRequest("person1","hughdata","4").source(jsonMap);
IndexResponse res = client.index(indexRequest);
String index = res.getIndex()
String type = res.getType()
String id = res.id
long version = res.getVersion()
DocWriteResponse.Result result = res.getResult();

    if (result == DocWriteResponse.Result.CREATED){
        println("index created = "+result)
    }
    else if (result == DocWriteResponse.Result.UPDATED){
        println("index Updated = "+result)
    }
    ["index":index,"type": type,"id":id,"version":version]
}

=======================
code for get the client

class ESService {
RestHighLevelClient client=null
//TransportClient client=null
def RestHighLevelClient getClient(){
try {
String hostname = "localhost"
int port = 9200
String scheme = "http"

            client = new RestHighLevelClient(RestClient.builder(new HttpHost("localhost",9200,"http")))

            boolean pingResponse = client.ping()

            if (pingResponse == true) {
                print("connection established..." + pingResponse);
            } else {
                print("connection not established. Try again : " + pingResponse)
            }
            /*return client*/
        }
        catch (ElasticsearchException e){
            e.printStackTrace()
        }
        return client
    }

}

@essiembre
Copy link
Contributor

Does your issue involve the Norconex Elasticsearch Committer at all? If so, how are you using it? I think your question may be one for the Elasticsearch or Grail community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants