We are looking to code two arduinos to make them communicate either
Over what distance? With what hardware?
via tcp, udp, string or whatever is best suited
Mixing protocols and data formats is like putting shoes on a banana split. Why would you do that?
We wish arduino A to send a message to arduino B to turn a pin on or off.
Why doesn't Arduino A just do that? If you are going to string a wire so that the two can communicate, cut out the second one and just do it.
Then also send a tcp/udp message to a java server with date and time stamp for historical tracking.
It doesn't matter what language the server script is using. It's necessary only that the server script be able to cope with a GET request. The Arduino can make GET requests.
Are you sure that sending a datagram that the server could ignore is a good idea? I wouldn't use UDP for that data.