Hi I already configured always on(2016 EE R1) two node replica. I need to setup read intent routing connection depending on the role. That mean when I connect to Always on using listener name using SQL Server management studio and setup "additional connection parameters ApplicationIntent =ReadOnly. After connect I checked the server select @@servername and always connect to active primary.
Before that I set up read only routing as follows. This has executed this same script on both nodes while active by failover over and fail back process.
secondly I tested though following method. But still I can see the primary node.
sqlcmd -s AGlistener,50000 -E -d dbname -K ReadOnly
select @@SERVERNAME
go
Any one have this issue to resolution .