Middleton won 432 caps and scored 119 goals for Great Britain and England during a 16-year international career.
The 35-year-old, who started out at Doncaster Hockey Club, played in four Olympic games, four World Cups, eight European Championships and four Commonwealth Games.
Middleton said: “I have been thinking about this decision since Rio and now is the right time for me to step away from international hockey.
Doncaster Rovers ‘were never going to match my ambitions’ claims former boss Darren Ferguson
Gary McSheffrey plays down transfer interest in Doncaster Rovers’ fringe players
Doncaster Rovers’ injury update as Joe Olowu likely to miss AFC Wimbledon trip
No regrets about turning down new Rangers contract says Doncaster Rovers defender James Maxwell
Police yet to decide whether to charge three Doncaster Rovers fans who invaded pitch
“Priorities in my life have shifted and I am excited to move on to the next phase.
“I feel I have given everything I possibly could to get the best out of myself in the last fifteen years, none more so than the build up to the world cup last December and I'm not sure I could motivate myself to that level again.
“It has been an honour to represent my country for so many years and it has been a dream job for me.
“I hope people could see just how much I enjoy playing the game whether at an Olympics or with Sandy and Redders on the cabbage patch back in Donny.
“Thanks to everyone who has coached, played with or supported me during my career.
“I look forward to sitting back and watching Great Britain and England knowing that they are in a good place to challenge the best in the world and I will be supporting them every step of the way.
He added: “Thanks to all the people I have met along the way around the world, I have been incredibly lucky to have made so many great friends through the sport who I share so many memories with.
“Finally, thanks to my family for all you have done for me. I couldn't have done it without you and I massively appreciate all the support you have given me over the years.”
A statement from Great Britain Hockey’s press office said: “Barry’s 432 caps and 119 goals for Great Britain and England make him one of the greatest athletes in the nation’s history from any sport, let alone hockey, and we congratulate him on a fantastic career.
“Having played in four Olympic games, four World Cups, eight European Championships and four Commonwealth Games, the 35-year deserves his status as a true legend of the sport.
“He was named in the world team of the year on three occasions, and fittingly was nominated for FIH world player of the year in 2018, his final year in international hockey.
“Doncaster-born Barry finishes his career with global respect in the hockey world, not just for his ability on the pitch, but also for his conduct off the field of play; professionalism, selflessness and the manner in which he showcases the best of our sport.
“His leadership enabled him to captain the nation for the best part of a decade, leading England to EuroHockey gold in 2009, as well as skippering Great Britain at two Olympics, including fourth at the London games in 2012, the men’s team’s best Olympic finish since Seoul 1988.
“At club level, he has proudly represented Doncaster, Cannock, East Grinstead and Holcombe, as well as Der Club an der Alster in Germany, HGC in Holland and Ranchi Rays in India.
“Barry is currently enjoying an extended break in Australasia with his wife Beckie, who herself played 104 times for Great Britain and England.”
Ed Barney, Great Britain and England performance director, said: “It is difficult to find the right words to articulate the contribution that Barry has made to the sport. Barry has embodied everything that the sport stands for: a consummate professional, an inspiring role model for everyone involved in the game and a genuine gentleman who is truly respected by teammates, opposition and staff.
“Sometimes in life you are fortunate to work with or come in to contact with truly exceptional people. Barry is one of those people and it has been England and Great Britain Hockey’s absolute privilege to work with Barry over the past 15 years – he will be sorely missed.
“On a personal level, we couldn’t wish Barry and Beckie more happiness and fulfilment in their new ventures over the coming months and years.”
Men’s head coach Danny Kerry said: “It was an absolute privilege to work with Barry during the short run up to the world cup.
“He is the epitome of world class, a phrase over used and often misunderstood, but not in this instance.
“He has taken a good amount of time to come to this decision, we have naturally supported him throughout that, now we will of course miss the many qualities he brought to the squad.
“Barry has given an enormous amount to England and GB Hockey and the sport has been a better place for his presence.
“We know Barry intends to stay involved with British hockey which is fantastic. We wish him all the best for the future and are delighted he will be giving back to the sport he is passionate about.”