Hello @Madanala, Jayashree ,
Do you want to deploy your own custom Azure IoT edge module written in Java?
Please do some investigation first by creating this custom example module in Java.
This will show you which libraries are needed and how to make use of the routing with input and output.
From there you can either rework your existing code or migrate your code into the VS Code Azure IoT Edge module template.
There are no Rest APIs involved on the edge. Yes, the IoT Hub and Device provisioning both have a rest API (next to eg. CLI) but this is for managing the resources, just like the functionality seen in the Azure portal.
Deployment of modules under Azure IoT Edge (modules capable of connecting to the IoT Edge routing mechanism or generic containers like grafana or influxdb) is always done using the deployment manifest.
In this deployment manifest, you can add container create options so you can configure eg. environment variables, ports, serial ports, volumes, etc. It's on par with what you see in Docker.
Secrets could be added in the container create options (eg. as environment variables). But that is quite static (if these secrets change, you have to deploy the whole deployment manifest as an update). A common alternative is the use of Module Twin desired properties (each module has its own desired/reported properties, just like the device twin). These can be altered per module so it's perfect for custom modules.
Again, put some time into learning the rich options of Azure IoT Edge.
This MS Learn module is a nice starting point.