1
0
-1

i am using fluent services to call micro services. all micro service call need few common parameters to pass as header. Now i am hard coding those common parameters as below in each services code to call micro services.

What is the best way to create a utility class and reuse that utility class for all service and api calls?

Example:

Map Header = new HashMap();
Header.put("Accept", "application/json");
Header.put("client_id", "9999999");
Header.put("Authorization", "9999999");
Header.put("uuid", "6a5b3c20388e");
Header.put("Content-Type", "application/json");

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1
      1. Umakanta Dalai

        Hi Ben,

        we are not using any IDE. we are directly writing code in TM. Please guide how to write and common utility class and how to access common variable or methods in side it from another fluent service.

      2. Ben Warner

        Is there a strong reason why you are not using an IDE? There are many advantages.

        There is no facility within TM for retaining common groovy classes outside of the service code itself. This is a one of the benefits of IDE integration.

      CommentAdd your comment...