kdb gateway server

hi,

i m using kdb q tickerplant architecture, how do i use the gateway server.

can i send the query to a particular port and does kdb route it to the correct service [realtime or historical] based on the date specified.

i m using java to query the database.

Thanks,

Niraj