# Performance testing a Java code sample

**URL:** <https://community.gatling.io/t/performance-testing-a-java-code-sample/6592>\
**Category:** Gatling (Open-Source)\
**Created:** [March 17, 2022, 1:41pm UTC](https://community.gatling.io/t/performance-testing-a-java-code-sample/6592 "2022-03-17T13:41:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AshishChadda](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@AshishChadda](https://community.gatling.io/u/AshishChadda)\
**Post date:** [March 17, 2022, 1:41pm UTC](https://community.gatling.io/t/performance-testing-a-java-code-sample/6592/1 "2022-03-17T13:41:45Z")

</div>

Do we have the equivalent of the Jmeter “Java Request sampler” in Gatling? Would you share a sample or documentation on how to perform a simple java micro-service test, which doesn’t expose an endpoint and needs a client to invoke the application?

Thanks

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [March 28, 2022, 4:23pm UTC](https://community.gatling.io/t/performance-testing-a-java-code-sample/6592/2 "2022-03-28T16:23:45Z")

</div>

No we don’t. Your typical microservice Java client is implemented in a blocking fashion, which has very poor performance and doesn’t play well with Gatling’s architecture. Better consider using Gatling’s built-in protocol supports such as HTTP.

---

<div class="post-metadata">

**Author:** ![AshishChadda](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@AshishChadda](https://community.gatling.io/u/AshishChadda)\
**Post date:** [March 28, 2022, 4:48pm UTC](https://community.gatling.io/t/performance-testing-a-java-code-sample/6592/3 "2022-03-28T16:48:57Z")

</div>

Thanks, Well I read this post:

> <https://stackoverflow.com/questions/64593941/how-can-one-execute-java-code-using-gatling-load-testing-framework>

And it appears that we can import the java class and run Java code via Gatling. But I was wondering if we can measure the performance of Java Code, similar to Jmeter Java Request.
