Looks like you have symptoms of urinary tract infection (UTI), coupled with epididymitis, orchitis or both. The infection may also be present in accessory sex glands. So consult an STD specialist initially so that he will get your urine and semen and if necessary prostate secretions for infection, have them cultured to identify the infecting organism and offer correct medication.
If urological problems such as stones are suspected he will refer yo to a urologist.
If you do this early you will be saving yourself from such problems as chronic prostatitis or epididymitis.
Though it's unfortunate but might be UTI due to Kidney stones lesslikely hernia still screen with urine Examination R n M, x ray n USG whole abdomen and pelvis, better consult surgeon nr by well resolve things authentically