I think you missunderstood the $this->Model->exists();
It will look for id
field not the $thread_id
you provided.... So, try this-
public function view_thread($thread_id = null) {
if(empty($thread_id)){
throw new NotFoundException(__('Invalid message'));
}
$options = array('conditions' => array('Message.thread_id' => $thread_id));
$messages = $this->Message->find('all', $options);
if(empty($messages)){
throw new NotFoundException(__('Invalid message'));
}
$this->set(compact('messages'));
}